Ciaran McCreesh wrote:
To be certain my original CFLAGS was "-march=athlon-xp -O3 -mmmx -msse -m3dnow -mfpmath=sse -pipe" which I changed to "-march=athlon-xp -O2 -mfpmath=sse -fomit-frame-pointer -pipe". Come to think of it the performance gain may be due to the omit-frame-pointer flag. Comments?


I'm pretty sure -O3 includes omit-frame-pointer by default...

Nope. I believe the frame pointer is needed by debuggers and debugging should still be possible with -O3. The gcc manual states:


[
-O3 Optimize yet more. -O3 turns on all optimizations specified by -O2 and also turns on the -finline-functions and -frename-registers options.
]


and -O2 does not exclude frame pointers. Excluding frame pointers, _could_ explain a rather large gain in performance though:

[
-fomit-frame-pointer
Don't keep the frame pointer in a register for functions that don't
need one.  This avoids the instructions to save, set up and restore
frame pointers; it also makes an extra register available in many
functions.  It also makes debugging impossible on some machines.
]

But then again. I'm no expert on compilers, and could be wrong in how i intepret the manual...

--
hw



--
[EMAIL PROTECTED] mailing list



Reply via email to