View previous topic :: View next topic |
Author |
Message |
barry Guest
|
Posted: Wed May 01, 2002 10:12 pm Post subject: Safe optimisation levels for compilation |
|
|
Using an Athlon XP processor. What's the safest highest level optimisation in /etc/make.conf?
I've tried various options. Recommended for high performance was:
-O3 -fomit-frame-pointer -march=i686 -malign-functions=4 -funroll-loops -fexpensive-optimizations -malign-double -fschedule-insns2 -mwide-multiply
'-malign-double' breaks glibc for instance, and these options also break C++ programs altogether.
-O3 -fomit-frame-pointer -march=i686 -malign-functions=4
Are these definitely safe? Anything else that can be added?
Barry |
|
Back to top |
|
|
mb Guru
Joined: 25 Apr 2002 Posts: 355 Location: Hessen | .de
|
Posted: Thu May 02, 2002 7:34 am Post subject: |
|
|
looks good..
but.. correct me if i'm wrong.. -malign-functions= will be automatically set to 4 by the compiler if your cpu >= 486
btw: why don't you try gcc304 with athlon optimisation ??
i compiled my system / kernel / kde with no problems...
#mb |
|
Back to top |
|
|
barry Apprentice
Joined: 01 May 2002 Posts: 170 Location: UK
|
Posted: Thu May 02, 2002 10:10 am Post subject: |
|
|
Setting -malign-functions=4 causes the glibc compilation to bomb out every time. As for gcc 3.0.4, the consensus seems to be that it's too unstable. |
|
Back to top |
|
|
RickN n00b
Joined: 29 Apr 2002 Posts: 26
|
Posted: Thu May 02, 2002 10:46 am Post subject: |
|
|
This is what is in the faq:
Quote: | -O3 -mcpu=i686 -march=i686 -fforce-addr -fomit-frame-pointer -funroll-loops -frerun-cse-after-loop -frerun-loop-opt -malign-functions=4 |
I added -pipe to this, not knowing what it does, but it was in all the examples in make.conf. These settings allowed me to compile my base system with no problems. |
|
Back to top |
|
|
Malakin Veteran
Joined: 14 Apr 2002 Posts: 1692 Location: Victoria BC Canada
|
Posted: Thu May 02, 2002 11:34 am Post subject: |
|
|
Here's a link to the manual if you'd like to look things up.
http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html
The faq indirectly suggests not using it but I used -ffast-math on everything after I hit stage 3 and never had any problems.
Note that according to the manual turning on -funroll-loops also enables both -fstrength-reduce and -frerun-cse-after-loop so you need not specify -frerun-cse-after-loop separately.
Quote: | -malign-functions=num
Align the start of functions to a 2 raised to num byte boundary. If `-malign-functions' is not specified, the default is 2 if compiling for 32 bit sparc, and 5 if compiling for 64 bit sparc. |
Quote: | -pipe
Use pipes rather than temporary files for communication between the various stages of compilation. This fails to work on some systems where the assembler is unable to read from a pipe; but the GNU assembler has no trouble. |
|
|
Back to top |
|
|
mb Guru
Joined: 25 Apr 2002 Posts: 355 Location: Hessen | .de
|
Posted: Thu May 02, 2002 11:36 am Post subject: |
|
|
gcc manual:
Quote: |
-pipe
Use pipes rather than temporary files for communication between the various stages of compilation. This fails to work on some systems where the assembler is unable to read from a pipe; but the GNU assembler has no trouble.
|
@malakin
strange.. in the 304 docu
Quote: |
-malign-functions=num
Align the start of functions to a 2 raised to num byte boundary. If `-malign-functions' is not specified, the default is 2 if optimizing for a 386, and 4 if optimizing for a 486.
|
|
|
Back to top |
|
|
RickN n00b
Joined: 29 Apr 2002 Posts: 26
|
Posted: Thu May 02, 2002 11:45 am Post subject: |
|
|
Malakin wrote: | [..]Note that according to the manual turning on -funroll-loops also enables both -fstrength-reduce and -frerun-cse-after-loop so you need not specify -frerun-cse-after-loop separately.
|
Mmmm, yes well, I don't like implicitly enabled options |
|
Back to top |
|
|
Guest
|
Posted: Thu May 02, 2002 12:22 pm Post subject: |
|
|
Quote: | Mmmm, yes well, I don't like implicitly enabled options |
But in this case it makes sense, doesn't it? Unrolling loops alone without a case optimization pass afterwards is ... well ... not very good optimized. |
|
Back to top |
|
|
|