OK, how about this: if you don't trust the code, don't use the latest whiz bang optimizations!
The documentation for GCC should specifically warn about optimizations that can do bad things
with questionable code. As an example, here is a quote from the "Sun Workshop 6 update 2" man
-xO3 In addition to optimizations performed at the
-xO2 level, also optimizes references and
definitions for external variables. This
level does not trace the effects of pointer
assignments. When compiling either device
drivers that are not properly protected by
volatile, or programs that modify external
variables from within signal handlers, use
Let's not penalize GCC because of how some people will use/abuse it.