This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/OMAPL138B-EP: Function inlining

Part Number: OMAPL138B-EP

Tool/software: Code Composer Studio


Dear all,

I am referring to the C6000 compiler in CCS 5.1.1. We are using -O3 -ms3

The compiler seems to refuse inlining of functions involving struct or volatile parameters. This is also mentioned in spru187t section 2.11.5 Inlining Restrictions. Consequently, I also get message 681 'The function ... cannot be inlined'. (This message refers only to the function to be inlined, not to the place of call)

However, we are using short unions very often for type conversion. A (senseless) example:

--------------------------------------
typedef struct {
    int low;
    int high;
} int32separate;

typedef union {
  long long     i64;
  int32separate isep;      
} int64var;

inline int64var test_add(int64var x)
{
  int64var result = x;
  result.isep.low ++;
  result.isep.high ++;

  return result;
}

int64var test_var_dummy;

void test_add_main(void)
{
  test_var_dummy = test_add(test_var_dummy);
}
--------------------------------------

I checked again that this has been working (and has been inlined) on a different platform with GCC 4.4.2, and has been the fastest solution there.

Has the behaviour changed in GCC, or is this something TI DSP-specific? Is there any way to override this?

Thanks for any help
Alexander

  • The answer will depend strongly on the compiler version, which is not the same as the CCS version. But note also that -ms3 is an option for smaller code size, and will also tend to inhibit inlining.
  • Please view this video to learn how to determine the version of the compiler.

    Thanks and regards,

    -George

  • Compiler Version is TI v7.3.1

    eabi (ELF)

    Thanks

    Alexander

  • Compiler version 7.3.1 is over 5 years old.  I recommend you upgrade to at least version 7.3.23.  Theses releases differ only in bug fixes.  But there are many such fixes.  And one of them fixes this inlining problem.

    Build the short test case from the first post with version 7.3.23 and the options --abi=eabi --opt_level=3, then see the function test_add is inlined, and not called.

    Please see the wiki article titled Compiler Releases to learn how to upgrade compiler versions.

    Thanks and regards,

    -George

  • The issue was fixed in 7.3.5. It was an improvement, not a defect, so there's nothing in SDOWP or the defect history.
  • I am having Trouble with the Compiler update.

    Using Help/ Install Software, and the Code Generation Tools updates Server, the process starts, but after download I get an error saying

    "An error occurred while collecting items to be installed

    session context was:(profile=epp.package.cpp, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).

    Problems downloading artifact: org.eclipse.update.feature,com.ti.cgt.c6000.8.1.win32,8.1.2.

    Error reading signed content:C:\Users\baehalex\AppData\Local\Temp\signatureFile1689693333280204162.jar

    An error occurred while processing the signatures for the file: C:\Users\baehalex\AppData\Local\Temp\signatureFile1689693333280204162.jar"

    This is true for any compiler that I select, here it was 8.1.2.


    Using the manual download, I get a file named "ti_cgt_c6000_7.3.23_windows_installer[1]" but do not know what to do with it. This file is not recognized by the manual upgrade from Window/ Preferences/CCS/Build/Compilers.

    THanks for any help
    Alexander

  • Alexander Baehr said:
    Using Help/ Install Software, and the Code Generation Tools updates Server, the process starts, but after download I get an error

    I apologize for the problem.  I don't know how this happened.  I am looking into it.

    Alexander Baehr said:
    Using the manual download, I get a file named "ti_cgt_c6000_7.3.23_windows_installer[1]" but do not know what to do with it.

    You should get a file named ti_cgt_c6000_7.3.23_windows_installer.exe .  It is a self-extracting executable.  Just run it.  A dialog box pops up which guides you through the installation.  You probably want to install it in the usual place CCS installs compilers.  Something similar to ...

    C:\ti\ccsv6\tools\compiler\c6000_7.3.23

    Next, you need to have CCS discover this compiler.  Please see the wiki article Compiler Installation and Selection for the details.

    Thanks and regards,

    -George

  • Re-naming the download file to .exe worked fine. I have now installed 7.3.23 in parallel.

    The inlining Problem is gone with 7.3.23.

    Thanks
    Alexander