User`s guide

C for DSP56800E
Deadstripping and Link Order
133Targeting MC56F83xx/DSP5685x Controllers
for (i=0; i<100; i++) { MyFunc(i); }
for (j=0; j<100; j++) { MyFunc(j); }
However, if the code included the expression MyFunc (i+j), the variables would
be in use at the same time. The compiler would store the two variables in different
registers.
For DSP56800E development, you can instruct the compiler to:
1. Store all local variables on the stack. — (That is, do not perform register
coloring.) The compiler loads and stores local variables when you read them and
write to them. You may prefer this behavior during debugging, because it
guarantees meaningful values for all variables, from initialization through the end
of the function. To have the compiler behave this way, specify optimization
Level 0, in the Global Optimizations settings panel.
2. Place as many local variables as possible in registers. — (That is, do perform
register coloring.) To have the compiler behave this way, specify optimization
Level 1 or higher, in the Global Optimizations settings panel.
NOTE
Optimization Level 0 is best for code that you will debug after
compilation. Other optimization levels include register coloring. If
you compile code with an optimization level greater than 0, then
debug the code, register coloring could produce unexpected results.
Variables declared volatile (or those that have the address taken) are not kept
in registers and may be useful in the presence of interrupts.
3. Run Peephole Optimization. — The compiler eliminates some compare
instructions and improves branch sequences. Peephole optimizations are small
and local optimizations that eliminate some compare instructions and improve
branch sequences. To have the compiler behave this way, specify optimization
Levels 1 through 4, in the Global Optimizations settings panel.
Deadstripping and Link Order
The M56800E Linker deadstrips unused code and data only from files compiled by the
CodeWarrior C compiler. The linker never deadstrips assembler relocatable files or C
object files built by other compilers.