OPTIMIZATIONS
Function
-Ona
None
None
None
None
After optimization, the Compiler redefines variables that may be written by a pointer indirection or an array access. This option prevents the Compiler from redefining these variables, which allows you to reuse already-loaded variables or equivalent constants. Use this option only when you are sure no real writes of aliases to a variable memory location will occur.
Do not compile with -Ona.
void main(void) {
int a = 0, *p = &a;
*p = 1; // real write by the alias *p
if(a == 0) Error(); // if -Ona is specified,
// Error() is called!
}