OPTIMIZATIONS
Function
-Oncn
None
None
None
None
This option prevents the Compiler from folding constants when the resulting constant is new. The option affects only those processors where constants are difficult to load (for example, RISC processors). On other processors this option makes no change.
void main(void) { int a = 1, b = 2, c, d; c = a + b; d = a * b; }
Case (1) without the -Oncn option (pseudo code):
a MOVE 1
b MOVE 2
c MOVE 3
d MOVE 2
Case (2) with the -Oncn option (pseudo code):
a MOVE 1
b MOVE 2
c ADD a,b
d MOVE 2
The constant 3 is a new constant that does not appear in the source. The constant 2 is already present, so it is still propagated.
-Oncn