OPTIMIZATIONS
Compilation unit
-OnCopyDown
None
None
None
None
With usual startup code, all global variables are first set to 0 (zero out). If the definition contained an initialization value, this initialization value is copied to the variable (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 ELF format, the object-file format permits optimization only if the whole array or structure is initialized with 0.
int i=0;
int arr[10]={1,0,0,0,0,0,0,0,0,0};
If this option is present, no copy down is generated for i.
For the arr array, it is not possible to separate initialization with 0 from initialization with 1.