------- Comment #17 from dick_guertin at yahoo dot com 2006-01-19 06:41 ------- I went back and recompiled all modules with -O -g to see what effect this has on the order of static data. What I found was that all static data occurred in memory in the order declared in the source code. This was NOT true with -O2, where static data was moved around in some unknown order. I read through the 'man gcc' pages very carefully, and could NOT see any -option that would control static data placement. Therefore, -O2 is a show-stopper for this program because static data is NOT laid out in memory in the order declared in the program source. Given this fact, it should be possible for me to create a testcase that shows static data moves around with -O2, and stays in declared order with -O.
-- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25791