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.

TMS320F28075: code execution time longer with optimization level set to 4 than set to 1

Part Number: TMS320F28075

Hi,

my customer is using F28075, and they have the same code in their ISR.

They examined the execution time of the ISR code with the clock tool in CCS.

When they set the optimization level to 1, the clock shows that the piece of code in ISR will need 260 clocks, 

When they set the optimization level to 4, the clock shows that the piece of code in ISR will need 560 clocks, 

Their code mainly consists of some +, -, * functions like below:

float32 a,b,ab,aRMS,aAVG;//global variables

    void func()//真实函数中全部是如下不同变量的类似语句和运算

    {

         ab = a -b;

        aRMS += a*a;

        aAVG +=a;

They are confused that with higher optimization level, the execution time will be even longer(which they expected to be shorter since it's optimized).

    }