This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Newbie Questions about Optimization
- To: David Ronis <ronis at onsager dot chem dot mcgill dot ca>
- Subject: Re: Newbie Questions about Optimization
- From: Marc Lehmann <pcg at goof dot com>
- Date: Thu, 4 Dec 1997 03:08:46 +0100
- Cc: egcs at cygnus dot com
- References: <199712032330.SAA00376@onsager.chem.mcgill.ca.>
> 1. is the set of flags that should get the most aggressive optimization:
>
> -O3 -march=pentium -ffast-math -funroll-loops -malign-double
> -malign-loops=2 -malign-jumps=2 -malign-functions=2
You could also give -mno-ieee and -funroll-all-loops a try.
And for pentiums, use -malign-*=0, for ppros use -malign-*=4
> In particular, are higher -O levels supported? [They don't appear to be
yes.. but -O6 -O69 etc.. are only counted as -O3
> according to the info files]. Also, are the various alignment options
> necessary or are they implied by the -march=pentium flag?
They should be implied, but an alignment of 2 for pentiums is not good.
> 2. If I understood the info page correctly, -march=pentium means that the
> code will only run on a pentium.
no.. in theory, -arch=xxx means use xxx-specific instructions,
but there are no pentium-specific instructions, so the code will
run on 486 and below.
the ppro, on the other hand, HAS new instructions, so -march=pentiumpro
*will* generate code that sometimes won't run on on pentiums and below.
-----==- |
----==-- _ |
---==---(_)__ __ ____ __ Marc Lehmann +--
--==---/ / _ \/ // /\ \/ / pcg@goof.com |e|
-=====/_/_//_/\_,_/ /_/\_\ --+
The choice of a GNU generation |
|