Boyd Stephen Smith Jr. wrote:
On Wednesday 27 September 2006 11:11, "Hemmann, Volker Armin" <[EMAIL PROTECTED]> wrote about 'Re: [gentoo-amd64] First Impressions':
-O3 don't do it. O2 is much, much safer and not really slower. It will
prevent a lot of breakage.

Bah!

-O3 breaking just doesn't happen anymore. I'm been running it for years. In fact -O3 has never generated invalid code [1] on x86 or amd64 platforms. It did for a period of time on ppc, but I think that was like 10 years ago.

The thing is that besides compiler errors, there are many program errors out there that are not caused by optimization levels, just exposed. From the point of view of a user however it doesn't matter where the error is. It is an error, and thus should be fixed.

Now, it is an open question whether -O3 is significantly faster than -O2 and depending on a number of factors it may actually be slower. -O3 will enlarge code to make execution paths shorter, but a cache miss is probably goes to blow away any advantage gained. Conversely, -Os will make execution paths longer to shrink code, and a cache hits may make up for the longer path. [2]

The main thing is that -O2 is the default at most places, and as such gets the most testing. That means that things generally work for -O2 where -O3 or -Os exposes bugs in the software.

Paul
--
[email protected] mailing list

Reply via email to