On Monday 03 Nov 2003 16:12, Van Eps, Nathan D. (James Tower) wrote: > <snip>. I wanted to make sure, so I emailed > gcc-help email address. Someone emailed me the following procedure to > determine exactly what flags are getting set for the different "O" > settings. > > > To figure out what the differences are between the various > optimization settings, do this: > > touch foo.cpp > g++ -O2 -save-temps -fverbose-asm -c foo.cpp > cat foo.s > > Replace "-O2" with the one(s) that you are interested in. �Compare > the differences in the .s files. �Make sure you save the foo.s that > you are interested to compare against... :-)
That's interesting. I just tried that. I could find no difference at all between these two: $ g++ -Os -save-temps -fverbose-asm -c foo.cpp $ g++ -O2 -save-temps -fverbose-asm -c foo.cpp ...which somewhat surprised me $ g++ -O3 -save-temps -fverbose-asm -c foo.cpp ...gave an extra "-frename-registers" I'll stick with this one: CFLAGS="-march=athlon-xp -O2 -pipe" Peter -- ====================================================================== Portage 2.0.49-r15 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.4.23_pre8-gss) i686 AMD Athlon(tm) XP 3200+ ====================================================================== -- [EMAIL PROTECTED] mailing list
