thanks, that helps a lot
I guess my question about using the wrong flags was more if I overoptimize
like if I use -mathlon-xp on my duron


Daniel Carrera wrote:


hi,
I have a few questions about setting compiler flags in make.conf.

1. what will happen if I get the wrong flags? will the binary just not run? or will it run will possibly undetectible errors? or will little bsd daemons start setting fire to my computer?



Well, I guess that it depends on just how wrong they are.
For instance, if you try to compile for the wrong architecture you'll get this error:


# On my SPARC system:
$ gcc -mathlon hello.c -o hello
cc1: Invalid option `athlon'

But, say that you are on an Athlon, and you specify '-march=i586', it just means that your code won't be as optimized as it could be.




2. what flags would you recommend for a 1.2 Duron? I heard that duron is basically an athlon tbird with less cache.
I was thinking of using these.


CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-tbird -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=athlon-tbird -O3 -pipe -fomit-frame-pointer"



I'm no expert at this, but all of those look pretty safe. I migh tadd -funroll-loops, and perhaps -frerun-cse-after-loop and -frerun-loop-opt

Each of those whould make your code faster, but compilation will take longer. In order to make compilation run faster you can first optimize gcc itself with the optimized flags.

Take a look at:

http://www.linuxgazette.com/issue88/piszcz.html

According to that test, it seems that optimizing gcc first will speed future compilation by about 25%.






-- [EMAIL PROTECTED] mailing list



Reply via email to