OPTIMIZATIONS
Function
-Ol<number>
<number>: number of registers to be used for induction variables
None
None
None
This option limits the number of loop induction variables the Compiler keeps in registers. Specify any number down to zero (no loop induction variables). The compiler reads and writes loop induction variables within the loop (for example, loop counter), and attempts to keep the variables in registers to reduce execution time and code size. The Compiler takes the optimal number (code density) when this option is not specified. Specifying a high number of loop induction variables may increase code size, particularly for spill and merge code.
Listing: With the -Ol0 Option (No Optimization, Pseudo Code) and Listing: Without Option (Optimized, Pseudo Assembler) use the example in Listing: Example (Abstract Code).
void main(char *s) { do { *s = 0; } while (*++s); }
The following listing shows pseudo disassembly with the -Ol0 option:
loop: LD s, Reg0 ST #0, [Reg0] INC Reg0 ST Reg0, s CMP [Reg0],#0 BNE loop
The following listing shows pseudo disassembly without the -Ol option (i.e., optimized). Loads and stores from or to variable s disappear.
loop: ST #0, s INC s CMP s,#0 BNE loop
-Ol1