HCS08 Compiler > Optimization > Tree optimizer

The Compiler contains a special optimizer which optimizes the internal tree data structure. This tree data structure holds the semantic of the program and represents the parsed statements and expressions.

This option disables the tree optimizer. This may be useful for debugging and for forcing the Compiler to produce `straightforward' code.

Use this panel to configure the tree optimizer options for the HCS08 compiler.

The following table lists and describes the Tree optimizer options for HC(S)08 compiler.

Table 1. Tool Settings - HCS08 Compiler > Optimization > Tree optimizer
Option Description
Disable all optimizations (-Ont) Disable all the optimizations.
Disable bit neg optimization (-Ont=~) Disable optimization of `~~i' into `i'.
Disable bit or optimization (-Ont=|) Disable optimization of `i|0xffff' into `0xffff'.
Disable exor optimization (-Ont=^) Disable optimization of `i^0' into `i'.
Disable if optimization (-Ont=w) Disable optimization of `if (1) i = 0;' into `i = 0;'.
Disable do optimization (-Ont=v) Disable optimization of `do ... while(0) into `...'.
Disable while optimization (-Ont=u) Disable optimization of `while(1) ...;' into `...;'.
Disable for optimization (-Ont=t) Disable optimization of `for(;;) ...' into `while(1) ...'.
Disable indirect optimization (-Ont=s) Disable optimization of `*&i' into `i'.
Disable 16-32 relative optimization (-Ont=r) Disable optimization of `L<=4' into 16-bit compares if 16-bit compares are better.
Disable 16-32 compare optimization (-Ont=q) Reduction of long compares into int compares if int compares are better: (-Ont=q to disable it).
Disable cut optimization (-Ont=p) Disable optimization of `(char)(long)i' into `(char)i'.
Disable cast optimization (-Ont=o) Disable optimization of `(short)(int)L' into `(short)L' if short and int have the same size.
Disable right shift optimization (-Ont=n) Optimization of shift optimizations (<<, -Ont=n to disable it)
Disable left shift optimization (-Ont=m) Optimization of shift optimizations (>>, -Ont=m to disable it)
Disable label optimization (-Ont=l) Disable optimization removal of labels if not used.
Disable transformations for inlining optimization (-Ont=j) This optimization transforms the syntax tree into an equivalent form in which more inlining cases can be done. This option only has an effect when inlining is enabled.
Disable address optimization (-Ont=i) Disable optimization of `&*p' into `p'.
Disable unary minus optimization (-Ont=h) Disable optimization of `-(-i)' into `i'.
Disable compare size optimization (-Ont=g) Disable optimization of compare size.
Disable condition optimization (-Ont=f) Disable optimization of `(a==0)' into `(!a)'.
Disable const swap optimization (-Ont=e) Disable optimization of `2*i' into `i*2'.
Disable binary operation optimization (-Ont=d) Disable optimization of `us & ui' into `us & (unsigned short) ui'.
Disable compare optimization (-Ont=c) Disable optimization of `if ((long)i)' into `if (i)'.
Disable constant folding optimization (-Ont=b) Disable optimization of `3+7' into `10'.
Disable statement optimization (-Ont=a) Disable optimization of last statement in function if result is not used.
Disable test optimization (-Ont=?) Disable optimization of `i = (int)(cond ? L1:L2);' into `i = cond ? (int)L1:(int)L2;'.
Disable assign optimization (-Ont=9) Disable optimization of `i=i;'.
Disable switch optimization (-Ont=8) Disable optimization of empty switch statement.
Disable extend optimization (-Ont=7) Disable optimization of `(long)(char)L' into `L'.
Disable or optimization (-Ont=1) Disable optimization of `a || 0' into `a'.
Disable and optimization (-Ont=0) Disable optimization of `a && 1' into `a'.
Disable div optimization (-Ont=/) Disable optimization of `a/1' into `a'.
Disable minus optimization (-Ont=-) Disable optimization of `a-0' into `a'.
Disable plus optimization (-Ont=+) Disable optimization of `a+0' into `a'.
Disable mul optimization (-Ont=*) Disable optimization of `a*1' into `a'.
Disable bit and optimization (-Ont=) Disable optimization of `a&0' into `0'.
Disable mod optimization (-Ont=%) Disable optimization of `a%1' into `0'.