Re: [offtopic] gcc optimisation flags documentation

Michael Meissner (meissner@cygnus.com)
Wed, 6 Oct 1999 09:43:40 -0400


On Wed, Oct 06, 1999 at 03:24:37PM +0200, Peter Hanecak wrote:
> On Wed, 6 Oct 1999, Marc Duponcheel wrote:
>
> > I (admit I) grew the habit of adding '-mcpu=i686 -O6' to gcc wherever possible,
> > so in /usr/src/linux I do:
>
> i was wondering now for about few months about gcc/egcs optimisation
> flags. i was looking at documentation (in /usr/doc/egcs, etc.) but found
> nothing about switches you mentioned. is there any documentation about
> such switches (and possibly some more info about optimisation itself -
> i.e. risk and advantages of optimising for particular CPU, ...) on the
> net?

Whomever packaged up your gcc release obviously didn't put the documentation
into /usr/doc/egcs-*. You might want to complain to them about this. To
figure out the options GCC supports, use the info command, and then do:

mgcc
mInvoking GCC
1

for a summary. Needless to say, GCC supports very many options. For straight
GCC, any -O level above -O3 is the same as -O3, but the pgcc varient added more
layers. As long as you don't use -march=i686, the compiler won't generate the
cmov and fcmov instructions that the Pentium and K6 don't support (the compiler
doesn't generate the bswap or 8 byte locking instructions in any case).

-- 
Michael Meissner, Cygnus Solutions
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886
email: meissner@cygnus.com	phone: 978-486-9304	fax: 978-692-4482

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/