MPLAB C30 optimization options for FreeRTOS

johnthorne wrote on Friday, April 10, 2009:

Is there a rational for selecting -O2 optimisation level for the dsPIC_MPLAB demo (FreeRTOS V5.2.0) ? I can’t find any explanation of the setting in the code and/or notes and the code appears to compile and run OK with any of the -O settings, but is there an optimum setting and any hidden dangers in not using -O2 ?

Full C30 setting is

-fno-omit-frame-pointer -g -Wall -DMPLAB_DSPIC_PORT -O2 -fno-schedule-insns -fno-schedule-insns2

rtel wrote on Friday, April 10, 2009:

There was a C30 compiler version that contained a bug at no optimisation - something to do with the frame pointer usage, hence the release was provided with optimisation turned on.  That was quite some time ago now and the compiler bug has long since been fixed.  If you are using a recent compiler version then I am not aware of any reason why it would not work at all optimisation levels.

Regards.