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