-Os versus -O2



On Sun, Jun 24, 2007 at 05:23:42PM -0700, Arjan van de Ven wrote:
On Sun, 2007-06-24 at 20:12 -0400, Benjamin LaHaise wrote:
On Sun, Jun 24, 2007 at 05:09:16PM -0700, Arjan van de Ven wrote:
if you care about the last cycle, don't specify -Os but -O2.
simple as that... you get what you tell the compiler you want.

Certain distros are shipping kernels compiled with -Os. And it's more
than just a couple of cycles.

so those distros pick space over some cycles. Who are you to then
override that choice ? ;-)

seriously, why are we even talking about overriding a choice the user
(or distro vendor as user) made here?

There is a real issue in the fact that compiling with -Os is available
through a kconfig option and AFAIR used by some distributions.

I doubt distros enable CONFIG_CC_OPTIMIZE_FOR_SIZE due to size
considerations, but due to speed considerations.

I wouldn't care if CONFIG_CC_OPTIMIZE_FOR_SIZE was hidden behind
CONFIG_EMBEDDED, but as long as it's available as a general purpose
option we have to consider it's performance.

The interesting questions are:
Does -Os still sometimes generate faster code with gcc 4.2?
If yes, why?

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [patch 00/2] improve .text size on gcc 4.0 and newer compilers
    ... > primarily due to the use of a "special" version of the compiler? ... > kernel patches and updates. ... distros "jump ahead" the bugfixes on that usually. ... It just means you're not getting bugfixes. ...
    (Linux-Kernel)
  • Re: Linux 2.6.22 released
    ... I just checked with today's gcc 4.2 freshly compiled and from a quick inspection ... i don't have a debian compiler and i normally use gcc 4.1 on my ... if Debian/sid is just using random compiler snapshots of the ... Also recompiling whole distros tends to find a lot of compiler bugs so ...
    (Linux-Kernel)
  • Re: Linux 2.6.22 released
    ... if Debian/sid is just using random compiler snapshots of the ... distros would not pick random nightly kernel builds). ...
    (Linux-Kernel)
  • Re: [patch 2/5] Add the Kconfig option for the stackprotector feature
    ... The only change is from a gcc version check to a feature check. ... We don't inform users about internal compiler version dependent things ... user visible effect. ... There had been need of rain for many days. ...
    (Linux-Kernel)
  • Userspace compiler support of "long long"
    ... AFAIR the Intel compiler claims to be gcc. ... Is there any userspace Linux compiler that does not support "long long"? ... There had been need of rain for many days. ...
    (Linux-Kernel)