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.

C6000 7.4.1 - Observation with O3 optimization level

Hello,

I am running a sample app on DSP and code snippet for app is given below.

volatile unsigned int count = 10;

main()

{

    printf("Example App\n");

    while (count);

}

ISR()

{

    printf("Count: %d \n",count-1);

    count--;

}

Setup:

The compiler used for this code is c6000 version 7.4.1 and optimization level is o3.

Expected Result:

Example App

Count:9

Count:8

....

Count:0

What is observed with O3 Level:

Example App

Count:9

Example App

Count:8

....

Example App

Count:0

When i changed the optimization level to o1 i got the expected output. Is this a known issue? If i want to use o3 optimization how can i solve the problem?

Thanks

  • Rishabh,

    Since this is a question about the compiler and not about a C67x Single Core DSP, a moderator will move this thread to the Compiler Forum to get the right people looking at the question.

    They may want to know which device or DSP you are targeting this for. And they may want to know how you are running this: simulator or EVM, and specifics on it.

    Also, all of your example code and all of your compiler switches may be needed to duplicate the problem. If you can create a small test case, it will be much easier to duplicate than from your pseudo code.

    Regards,
    RandyP

  • I cannot reproduce this.  As RandyP suggests, we'll need at minimum all of the compiler options, and we will probably need a more complete test case.  We may also need to see the definition of the interrupt vector table.

  • Thanks for the reply. I have shared the test case through an email.