Small correction: Another list member pointed out to me that
"fomit-frame-pointer" isn't enable for any of the "O" settings for x86
(according to the documentation). 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... :-)



>-----Original Message-----
>From: SN [mailto:[EMAIL PROTECTED]
>Sent: Sunday, November 02, 2003 5:26 PM
>To: [EMAIL PROTECTED]
>Subject: Re: [gentoo-user] bad gentoo performance
>
>
>Well since I had a crash 3 days ago I can tell you what my 
>exerience with
>CFLAGS:
>
>First install:
>
>Filesystem: ext3
>-march=athlon-xp -O3 -pipe  -funroll-loops
>
>Note: according to gcc manuall, fomit-frame-pointer 
>finline-functions and
>all the cra is already turned on by O3
>
>Second install:
>
>Filesystem: reiserfs
>-march=athlon-xp -02 -pipe
>
>
>By accident I was already doing a little test of my own, on the first
>install, startup time of konqueror, prelinked: 0,7s
>second install had only 0,6s
>Also the files, compiled binaries, libs were almost10% smaller. I guess
>that's one part of the faster startup.
>
>After studying the gcc manuall up and down I don't believe, 
>that the gentoo
>suggested O3 is not the best flag for compiling the whole 
>distro, I think it
>makes things much worse, only people should use that flag, who 
>already know,
>that they have certain functions in their programms that will 
>benefit from
>O3, which in most cases doesn't happen.
>
>Also some poeple still believe, that they have to add 50 other flags to
>their make.conf, cause gcc man shows them. Here is what gcc 
>manual on their
>HP says:
>
>O3 contains:
>
>
>          -fforce-mem
>          -foptimize-sibling-calls
>          -fstrength-reduce
>          -fcse-follow-jumps            -fcse-skip-blocks
>          -frerun-cse-after-loop            -frerun-loop-opt
>          -fgcse   -fgcse-lm   -fgcse-sm
>          -fdelete-null-pointer-checks
>          -fexpensive-optimizations
>          -fregmove
>          -fschedule-insns  -fschedule-insns2
>          -fsched-interblock -fsched-spec
>          -fcaller-saves
>          -fpeephole2
>          -freorder-blocks  -freorder-functions
>          -fstrict-aliasing
>          -falign-functions  -falign-jumps
>          -falign-loops  -falign-labels          -fdefer-pop
>          -fmerge-constants
>          -fthread-jumps
>          -floop-optimize
>          -fcrossjumping
>          -fif-conversion
>          -fif-conversion2
>          -fdelayed-branch
>          -fguess-branch-probability
>          -fcprop-registers
>-fforce-mem
>Force memory operands to be copied into registers before doing 
>arithmetic on
>them. This produces better code by making all memory 
>references potential
>common subexpressions. When they are not common 
>subexpressions, instruction
>combination should eliminate the separate register-load.
>Enabled at levels -O2, -O3, -Os.
>
>
>
>
>-fomit-frame-pointer
>Don't keep the frame pointer in a register for functions that 
>don't need
>one. This avoids the instructions to save, set up and restore frame
>pointers; it also makes an extra register available in many 
>functions. It
>also makes debugging impossible on some machines.
>On some machines, such as the VAX, this flag has no effect, because the
>standard calling sequence automatically handles the frame pointer and
>nothing is saved by pretending it doesn't exist. The 
>machine-description
>macro FRAME_POINTER_REQUIRED controls whether a target machine 
>supports this
>flag. See Register Usage.
>
>Enabled at levels -O, -O2, -O3, -Os.
>
>
>
>
>-foptimize-sibling-calls
>Optimize sibling and tail recursive calls.
>Enabled at levels -O2, -O3, -Os.
>
>
>
>
>-finline-functions
>Integrate all simple functions into their callers. The compiler
>heuristically decides which functions are simple enough to be worth
>integrating in this way.
>If all calls to a given function are integrated, and the function is
>declared static, then the function is normally not output as 
>assembler code
>in its own right.
>
>Enabled at level -O3
>
>
>
>So guys please, don't fall for that CFLAG hype, most of these 
>optimization
>tales are just plain mystery and I'd say 99% of the people, 
>that set CFLAGS
>don't even know what they are doing, they read posts in 
>threads then they
>post them themselves and so on. It's just plain crap.
>
>
>
>Set the right march and O2 and you won't loose over any other 
>distro, if you
>want fast startup times, prelink will do its job. Also you 
>have to note,
>that some distros use kernel patches that enhance speed, the 
>kernel from
>kernel.org ususally is very stable and works for most, but 
>isn't very much
>tuned to run for best performance.
>
>
>
>
>
>
>
>----- Original Message ----- 
>From: "Eric Marchionni" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Sunday, November 02, 2003 2:24 PM
>Subject: [gentoo-user] bad gentoo performance
>
>
>> hi
>>
>> what about that?
>>
>http://articles.linmagau.org/modules.php?op=modload&name=Sectio
ns&file=index&req=viewarticle&artid=227
>
> cheers,
> eric
>
>
> --
> [EMAIL PROTECTED] mailing list
>
>


--
[EMAIL PROTECTED] mailing list

--
[EMAIL PROTECTED] mailing list

Reply via email to