This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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
"-O2 -fomit-frame-pointer".

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,
No ads -- just very free (and somewhat unusual) code.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]