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.

C6x transform a finite loop as an infinite loop when compiled -O2 (c6748)

Hi,

I guess I've the same pb that could arise in gcc -O2.

My piece of code looks like:

...

while (!IoDevBuff->eltCount);

...

2 questions:

- How can I rewrite this line so it won't loop?

- Does C6x support options like  "-fno-aggressive-loop-optimizations" or "-fno-tree-vrp" in gcc?


Chip:C6748

Compiler:TI V7.4.4

Thanks

Bruno

  • Ok I've figured out my problem by adding the "volatile" keyword for "eltCount".
    Seems to work...
  • Bruno,

    We are glad to hear your problem is solved. 'volatile' is the most common issue in a case like this.

    For future reference, this is a hardware forum where the people who monitor it are knowledgeable about the devices, peripherals, and perhaps the driver code that is specific to a DSP device. We have a set of forums under Development Tools, especially Code Composer Forum and TI C/C++ Compiler Forum, in which your questions about the tools would get the best attention.

    We may know some of the tools answers here, but the people in those forums are more knowledgeable about those tools.

    For example, there are some gcc extensions that our compiler does support. I know they are listed in the Compiler Users Guide, but I do not know which ones they are. The experts in the TI C/C++ Compiler Forum would know.

    Regards,
    RandyP