Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 25965

Summary: gcc losing optimization with -O3
Product: Gentoo Linux Reporter: Bret Towe <magnade>
Component: New packagesAssignee: Please assign to toolchain <gcc-porting>
Status: RESOLVED INVALID    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Bret Towe 2003-08-05 11:02:53 UTC
not to long ago there was this story posted to slashdot
http://articles.linmagau.org/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=227
and it showed gentoo compiling the kernel ALOT slower than the other distros
i didnt think to much of it aside of how can this be?
anyhow after playing with a script a friend is writting i noticed that with -O3
gcc gets no optimzation but with cflags that have -O2 it gets that
i think this is why gcc is so much slower than the others
gcc should do a s/-O3/-O2/ if -O3 is not allowed to be compiled with


Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Bret Towe 2003-08-05 19:31:08 UTC
i ran some tests 
on a dual ppro2 200mhz
you get about 10 minute compile time difference for compiling a 2.5 kernel

oh gcc version is gcc-3.2.3-r1
Comment 2 Joshua Kinard gentoo-dev 2003-10-01 23:25:23 UTC
Resolving as INVALID as I really don't think there is much we can do, unless
you can provide some more information.

From what I've heard, gcc has gotten progressively slower in code compiliation
time since gcc-2.95.3, and it also produces larger executables.  I believe
the GCC Steering Committee is planning on addressing this issue in gcc-3.4
to speed up compiliation time as well as reduce generated code size (or something
to that effect).

It is also becoming common knowledge that -O3 really doesn't offer much more
optimization because I believe it is just -O2 with -funroll-loops tacked
on (and maybe one or two other optimizations), so people are likely to stray
away from using -O3 constantly, and only in certain situations.