Need Optimizer bug workaround

John Love-Jensen
Thu Apr 6 13:46:00 GMT 2006

Hi Tina,

To figure out which -f you may consider for tweaking, you can use this

g++ -fverbose-asm -S -Os foo.cpp -o foo.s.s

g++ -fverbose-asm -S -O1 foo.cpp -o foo.1.s

Look at files foo_s.s and foo_1.s.  At the tops of the files it tells you
the relevant tweakable flags.

I know that doesn't solve your problem at hand, but I hope it will be a
handy technique for diagnosis which particular flag is causing the grief.

Warning:  there may be optimizations that do not have an independently
tweakable flag associated with the optimization!

I've used this technique to figure out GCC 2.95 optimization bugs on the
SPARC platform.  Should work just as well on GCC on any platform, such as
Intel or PowerPC.


More information about the Gcc-help mailing list