Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 10606 - optimization flags and advice
Summary: optimization flags and advice
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs-user
Classification: Unclassified
Component: Gentoo Linux FAQ (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Stoyan Zhekov (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-11 18:09 UTC by Spider (RETIRED)
Modified: 2003-02-04 19:42 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Spider (RETIRED) gentoo-dev 2002-11-11 18:09:00 UTC
Could we get a notice that if something breaks with customized CFLAGS (in the
CFLAGS section), that the user is to try  "-march= -O2"  before reporting a bug?

I've had bugreports from people who use :
-march=pentium3 -O3  -pipe -fomit-frame-pointer -fexpensive-optimizations
-fprefetch-loop-arrays -ffast-math -funroll-loops -foptimize-sibling-calls
-freorder-blocks 

and it was only because of overoptimization that things refused to go through
configure stage even.
Comment 1 Stoyan Zhekov (RETIRED) gentoo-dev 2002-11-13 00:56:07 UTC
In witch document to add this? Install guide? FAQs? somewhere else?
Comment 2 Spider (RETIRED) gentoo-dev 2002-11-13 11:50:09 UTC
in the FAQ, preferrably directly after this section:
I'm finding things to be really unstable and I'm using "-O9 -ffast-math
-fomit-frame-pointer" optimizations. What gives? 

When you use any optimizations beyond -O3, you're really taking the risk of
having broken packages. Very aggressive optimizations sometimes cause the
compiler to streamline the assembly code to the point where it doesn't quite do
the same thing anymore. Loc-Dog (on IRC) uses -O3 -mcpu=i686 -march=i686
-fforce-addr -fomit-frame-pointer -funroll-loops -frerun-cse-after-loop
-frerun-loop-opt -malign-functions=4, which is about as much as I'd want to push
global optimization settings. Beyond this, it's best to use ultra-high
optimizations only with specific packages where you really need that extra 2%,
(eg graphics and various multimedia programs), and where you can easily test the
package to ensure that it hasn't been optimized into oblivion.
Comment 3 Stoyan Zhekov (RETIRED) gentoo-dev 2002-11-18 00:13:29 UTC
fixed in the CVS