[CLUE-Tech] Curious about GCC -O3

Ed Hill ed at eh3.com
Thu Apr 25 11:01:32 MDT 2002


On Thu, 2002-04-25 at 09:59, Matt Gushee wrote:
> I have a question about the GCC optimization flags. I remember that
> as recently as a couple of years ago, 'gcc -O3' was supposed to be
> be buggy, thus -O2 was the most common setting on most or all Linux
> distros. But I've gotten the impression more recently that -O3 is now
> safe to use in most cases; at any rate, I now compile most applications
> with -O3, and have not found it to cause any problems. So why is -O2
> still the default?


Hi Matt,

According to the manual, -O3 is equal to "-O2 -finline-functions".
I've used -O3 on occasion and had no problems.  I've also seen *no*
significant improvement in execution speed for -O3 versus -O2.

Have you ever run across a code where that optimization did give an
appreciable speed-up?  I'd guess that the occasions are rare...

Ed


-- 
Edward H. Hill III, PhD
Post-Doctoral Researcher   |  Email:       ed at eh3.com, ehill at mines.edu
Division of ESE            |  URL:         http://www.eh3.com
Colorado School of Mines   |  Phone:       303-273-3483
Golden, CO  80401          |  Fax:         303-273-3311
Key fingerprint = 5BDE 4DA1 66BE 4F7B BC17  3A0C 932B 7266 1E76 F123



More information about the clue-tech mailing list