7.30 --data_reorder, --no_data_reorder

Enables and disables automatic reordering of top-level data items, for example global variables.

The compiler can save memory by eliminating wasted space between data items. However, --data_reorder can break legacy code, if the code makes invalid assumptions about ordering of data by the compiler.
The ISO C Standard does not guarantee data order, so you must try to avoid writing code that depends on any assumed ordering. If you require data ordering, place the data items into a structure.

Default

The default is optimization-level dependent:
-O0:
--no_data_reorder
-O1, -O2, -O3:
--data_reorder
Related reference
7.111 -Onum
Non-ConfidentialPDF file icon PDF versionARM DUI0375E
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.