-Ont: Disable Tree Optimizer

Group

OPTIMIZATIONS

Scope

Function

Syntax
  -Ont[={%|&|*|+|-|/|0|1|7|8|9|?|^|a|b|c|d|e| 
  
   f|g|h|i|l|m|n|o|p|q|r|s|t|u|v|w|||~}] 
  
Arguments

%: Disable mod optimization

&: Disable bit and optimization

*: Disable mul optimization

+: Disable plus optimization

-: Disable minus optimization

/: Disable div optimization

0: Disable and optimization

1: Disable or optimization

7: Disable extend optimization

8: Disable switch optimization

9: Disable assign optimization

?: Disable test optimization

^: Disable xor optimization

a: Disable statement optimization

b: Disable constant folding optimization

c: Disable compare optimization

d: Disable binary operation optimization

e: Disable constant swap optimization

f: Disable condition optimization

g: Disable compare size optimization

h: Disable unary minus optimization

i: Disable address optimization

j: Disable transformations for inlining

l: Disable label optimization

m: Disable left shift optimization

n: Disable right shift optimization

o: Disable cast optimization

p: Disable cut optimization

q: Disable 16-32 compare optimization

r: Disable 16-32 relative optimization

s: Disable indirect optimization

t: Disable for optimization

u: Disable while optimization

v: Disable do optimization

w: Disable if optimization

|: Disable bit or optimization

~: Disable bit neg optimization

Default

If -Ont is specified, all optimizations are disabled

Defines

None

Pragmas

None

Description

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. Note that the optimizations below are just examples for the classes of optimizations.

If this option is set, the Compiler will not perform the following optimizations:

-Ont=~

Disable optimization of ` ~~i' into ` i'

-Ont=|

Disable optimization of ` i|0xffff' into ` 0xffff'

-Ont=w

Disable optimization of ` if (1) i = 0;' into ` i = 0;'

-Ont=v

Disable optimization of ` do ... while(0) into `...'

-Ont=u

Disable optimization of ‘while (cond) break;' into ‘cond;', provided there are no labels within the 'while' statement list.

-Ont=t

Disable optimization of ` for(;;) ...' into ` while(1) ...'

-Ont=s

Disable optimization of ` *&i' into ` i'

-Ont=r

Disable optimization of ` L<=4' into 16-bit compares if 16-bit compares are better

-Ont=q

Reduction of long compares into int compares if int compares are better: ( -Ont=q to disable it)

  if (uL == 0) 
  

is optimized into

  if ((int)(uL>>16) == 0 && (int)uL == 0) 
  
-Ont=p

Disable optimization of ` (char)(long)i' into ` (char)i'

-Ont=o

Disable optimization of ` (short)(int)L' into ` (short)L' if short and int have the same size

-Ont=n,-Ont=m:

Optimization of shift optimizations (<<, >>, -Ont=n or -Ont=m to disable it): Reduction of shift counts to unsigned char:

  uL = uL1 >> uL2; 
  

is optimized into:

  uL = uL1 >> (unsigned char)uL2; 
  

Optimization of zero shift counts:

  uL = uL1 >> 0; 
  

is optimized into:

  uL = uL1; 
  

Optimization of shift counts greater than the object to be shifted:

  uL = uL1 >> 40; 
  

is optimized into:

  uL = 0L; 
  

Strength reduction for operations followed by a cut operation:

  ch = uL1 * uL2; 
  

is optimized into:

  ch = (char)uL1 * (char)uL2; 
  

Replacing shift operations by load or store

  i = uL >> 16; 
  

is optimized into:

  i = *(int *)(&uL); 
  

Shift count reductions:

  ch = uL >> 17; 
  

is optimized into:

  ch = (*(char *)(&uL)+1)>>1; 
  

Optimization of shift combined with binary and:

  ch = (uL >> 25) & 0x10; 
  

is optimized into:

  ch = ((*(char *)(&uL))>>1) & 0x10; 
  
-Ont=l

Disable optimization removal of labels if not used

-Ont=i

Disable optimization of ` &*p' into ` p'

-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.

-Ont=h

Disable optimization of ` -(-i)' into ` i'

-Ont=f

Disable optimization of ` (a==0)' into ` (!a)'

-Ont=e

Disable optimization of ` 2*i' into ` i*2'

-Ont=d

Disable optimization of ` us & ui' into ` us & (unsigned short)ui'

-Ont=c

Disable optimization of ` if ((long)i)' into ` if (i)'

-Ont=b

Disable optimization of ` 3+7' into ` 10'

-Ont=a

Disable optimization of last statement in function if result is not used

-Ont=^

Disable optimization of ` i^0' into ` i'

-Ont=?

Disable optimization of ` i = (int)(cond ? L1:L2);' into ` i = cond ? (int)L1:(int)L2;'

-Ont=9

Disable optimization of ` i=i;'

-Ont=8

Disable optimization of empty switch statement

-Ont=7

Disable optimization of ` (long)(char)L' into ` L'

-Ont=1

Disable optimization of ` a || 0' into ` a'

-Ont=0

Disable optimization of ` a && 1' into ` a'

-Ont=/

Disable optimization of ` a/1' into ` a'

-Ont=-

Disable optimization of ` a-0' into ` a'

-Ont=+

Disable optimization of ` a+0' into ` a'

-Ont=*

Disable optimization of ` a*1' into ` a'

-Ont=&

Disable optimization of ` a&0' into ` 0'

-Ont=%

Disable optimization of ` a%1' into ` 0'

Example
  fibo.c -Ont