Need Optimizer bug workaround

Andrew Haley
Thu Apr 6 14:02:00 GMT 2006

Tina VanRoggen writes:
 > This is on Xcode 2.2.1, GCC 4.0.1.  The source code 
 > is quite old and runs on multiple platforms using 
 > other compilers.  The following call to SetupParameter 
 > passes in garbage for the pl variable when using the 
 > -Os (fastest/smallest) optimization.  Using -O1 
 > optimization works properly.  
 > My question is: is there a compiler flag that we can 
 > use with -Os that will turn off the optimization that 
 > is causing the problem?  We'd rather not use only
 > -O1 optimization.  There is likely other
 > code in our app that will have the same problem.
 > Thanks.

I agree with Graham Stott, -fno-strict-aliasing will do the trick, but
you'd be much better off fixing your code.


More information about the Gcc-help mailing list