OPTIMIZATIONS
Compilation unit
-OnCopyDown
None
None
None
None
Startup code usually clears all global variables to zero (zero out) and copies any non-zero initialization values to the variables (copy down). Because of this, it is not necessary to copy zero values unless the usual startup code is modified. If a modified startup code contains a copy down but not a zero out, use this option to prevent the compiler from removing the initialization.
In the HIWARE format, the object-file format permits the Compiler to remove single assignments in a structure or array initialization. In the ELF format, the Compiler optimizes only when the whole array or structure is initialized with zero.
int i=0;
int arr[10]={1,0,0,0,0,0,0,0,0,0};
Using this option, the compiler does not generate a copy down for i.
The initialization with zero optimization shown for the arr array only works in the HIWARE format. The ELF format requires initializing the whole array to zero.