GCC Optimization

Athena P lists at vega.uk.net
Sat Feb 10 11:04:39 PST 2007


Hi All

Having built quite a few LFS systems with great success I have now
decided I would like to compile a highly optimized build. I would
therefore be grateful if anybody would be able to give me advice on the
following optimization strings.

My system is a home grown 3.4 GHz Pentium4 (Prescott) with 2GB RAM and
over a 1TB of disk. So I have no problem with binary size ;--)

Firstly I have successfully built glibc-2.3.6 using the following
optimization, this is including running "make check" to ensure no
fundamental build errors. "Make Check" reports no errors! 

1]	"-O3 -march=prescott -march=prescott -mtune=prescott -mmmx -msse
-	msse2 -msse3 -m3dnow -pipe -mfpmath=sse"

I did try to compile glibc-2.3.6 using this string however I got various
errors during "Make Check" all to do with gcc-2.3.6/math. I would assume
that the additional optimization was just too much for the libc.

2]	-O3 -march=prescott -march=prescott -mtune=prescott -mmmx -msse
-msse2 	-msse3 -m3dnow -pipe -mfpmath=sse -minline-all-stringops
-fomit-frame-	pointer -malign-double -m128bit-long-double
-maccumulate-outgoing-args 


My GCC is gcc-4.0.3 and is build with default optimization; I assume
it's not a good idea to heavily optimize GCC, would this be right?

Anyway so my question to the list is this:

Is my first optimization sting [1] safe to use for the libc and is the
second string [2] safe to use for higher level parts of my system? 

If not, could anybody recommend a better optimization string?  

Also could anybody recommend nicer / better strings which would improve
performance on my system?

And, finally, in terms of pure performance (speed) is all this
optimization really worth the effort?

Many Thanks & Regards

Athena






More information about the lfs-support mailing list