Kenneth Prugh wrote:
Volker Armin Hemmann wrote:
On Montag, 23. Juli 2007, Alexander Skwar wrote:
Volker Armin Hemmann <[EMAIL PROTECTED]> wrote:
And then Os. That is a big nono.
Why's that?

Alexander Skwar
because several gcc have compiled crap with that flag in the past?



That was the past, -Os generally works fine on AMD64 now. That can be
evidenced by my fully -Os built system that works fine.

From my experience, the main "problem" with -Os is that it's rarely used, and not all that useful. It's essentially the same as -O2 with some optimizations turned off, to save space. The difference in binary size between -O2 and -Os has no, in my experience, been very significant. And -Os produces slower code than -O2.

More importantly, -O2 seems to be the "typical" optimization setting, and almost all free software packages are built and tested and generally "supported", for whatever that means in an open-source world, under -O2. If you report a bug in a package and you use -Os, the first thing the devs will ask is "recompile it using normal CFLAGS and try again."

So yes, recent gcc versions have been much better at not breaking code under -Os. At least, it's no more broken under -Os than under -O2. But given that disk space is dirt cheap and modern OS don't need to read an entire binary into memory to execute it, the actual, tangible benefits of using -Os over -O2 are minimal compared against the possible problems it might cause.

--Mike
--
[EMAIL PROTECTED] mailing list

Reply via email to