In the last episode (Jan 16), David Hedbor @ Pike developers forum said:
In the last episode (Jan 16), David Hedbor @ Pike developers forum said:
Is there a reason while '-O2' is the "max" -Ox flag and not -O3? I.e have there been any specific problems or are there other reasons?
All -O3 does is add -finline_functions and -frename_registers. Inline-functions tends to make the final code bigger than -O2, which could be an issue on machines with small caches, and the docs say that rename_registers can confuse gdb since a variable may exist in different registers over its lifetime. I usually use -O2 and -march or -mcpu (depending on the platform)
I'm specifically asking because the Intel compiler has a -O3 which might be worth enabling (even though to be honest it doesn't say that it will help - it might make things slower). From the docs:
At this point, you might as well check the compiler vendor and have customized optimization flags. Here's another interesting icc flag:
IA-32 Applications Only -prefetch[-]
Enables or disables prefetch insertion (requires -O3). Reduces wait time; optimum use is determined empirically.
Also, Compaq's CC for Alpha goes up to -O4, for what it's worth.