[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: tune gcc



On Mon, 17 Mar 2003 10:08:42 -0500
David Z Maze <dmaze@debian.org> wrote:

> Jerome BENOIT <jgmbenoit@wanadoo.fr> writes:
> 
> > I have a very naive question:
> > Can Debian tune the GNU C Compiler ?
> >
> > [e.g., put `-cpu=pentium' automaticly on Pentium box]
> 
> There's a pentium-builder package that tries to do this, or you can
> try to set CFLAGS for the program in question.  With a limited number
> of exceptions, though, conventional wisdom is that this buys you
> little in performance at the cost of portability of binaries to other
> x86-based machines.
> 
> -- 
Cflags are some kind of black magic thing as it appears to me.I got an
AMD Durom 900 so you should think I need to use the duron flag - naah
it's athlon-tbird.For reasons like that I don't think you can just have
default flags that are guaranteed to work - exept you use i386.
If you set the flag with -mcpu=CPU it still generates code that also
runs on i386 boxes.Only if you use -march=CPU the code only works on the
type of CPU you specify.
I usually go with -march=athlon-tbird -O2 -pipe which is pretty
conservative and didn't give me any trouble so far.
There is really good documentation on the gcc website about all this
stuff.

Klaus



Reply to: