This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Optimizations and gcc
- From: Jan Hubicka <jh at suse dot cz>
- To: Scott Robert Ladd <scott at coyotegulch dot com>
- Cc: "Gcc at Gnu dot Org" <gcc at gnu dot org>
- Date: Thu, 9 May 2002 16:31:18 +0200
- Subject: Re: Optimizations and gcc
- References: <FKEAJLBKJCGBDJJIPJLJMEOKCFAA.scott@coyotegulch.com>
> I've been testing various combinations of options with gcc 3.0.4.
>
> The documentation is, to me, misleading. For example, it states that
>
> "`-O2' turns on all optional optimizations except for loop unrolling,
> function inlining, and register renaming."
>
> and
>
> "`-O3' turns on all optimizations specified by `-O2' and also turns on the
> `-finline-functions' and `-frename-registers' options."
>
> The above is not entirely correct, and it certainly leaves out important
> detail. Which specific options *do* -O2 and -O3 enable? When -O2 states
> "all... except for", I assume it is beging very specific -- and it isn't!
>
> For example: Does -O2 imply the -fomit-frame-pointer option? If I take the
> wording at face value -O2 *should* imply -fomit-frame-pointer -- yet, when I
> compile code with "-O2", it is slower than code compiled with
> "-O2 -fomit-frame-pointer".
I need, this is confusing. I think there used to be full list, but somehow
it is not there anymore. There are few notable exceptions of optimizations
not enabled - like loop unrolling and the experimental stuff - SSA.
I think it is mentioned in the documentations of particular options
(like -ffast-math mentions it can not be enabled by default on some level),
but it is nout really enought. I would suggest to explicitly mention for
each optimization option at what level it is enabled. This can be easier to
maintain than the pure list.
Honza