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. > > Also, some applications break with just -O2. I count 8 ebuilds that > replace this cflag specifically, there could be others that filter it or > filter/replace optimization options entirely. My methodology is available > on request. > > 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] > > So, which is best depends on the program and on the CPU used (not only > instruction set, but also cache sizes). Therefore, making a sweeping > recommendations is not recommended, but that doesn't stop anyone. My > recommendation is -O3. :) > > Naturally, Gentoo wins over binary distros on this point, since you can use > CFLAGS that are appropriate for your specific processor (including cflags > which control the optimization tradeoff parameters) as well as tuning for > the specific application. > > I've always used "-O3". The only exception is busybox, when I compile it for initrd/initramfs. In those cases I prefer "-Os". I've never seen a package which explodes with "-O3" and compiles with "-O2". That's the reason I hate to find that "replace-flags -O? -O2" stuff in the ebuilds. I think I've read somewhere in *.gentoo.org that It should be reported if a "testing" version works fine so it could get in the stable tree faster. Should this "replace-flags" stuff be reported when the package compiles successfully with "-O3"?
-- Best regards, Daniel -- gentoo-amd64@gentoo.org mailing list