This is the mail archive of the
mailing list for the GCC project.
Optimizations and gcc
- From: "Scott Robert Ladd" <scott at coyotegulch dot com>
- To: "Gcc at Gnu dot Org" <gcc at gnu dot org>
- Date: Thu, 9 May 2002 10:26:47 -0400
- Subject: Optimizations and gcc
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."
"`-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
Short of digging through the gcc source code, I wonder if anyone has
catalogued what, precisely, is implied by -O1, -O2, and -O3. If no one has,
I'll endeavour to undertake this task myself, at least for Intel 32-bit
Scott Robert Ladd
Coyote Gulch Productions, http://www.coyotegulch.com
No ads -- just very free (and somewhat unusual) code.