Re: [2.6 patch] add a config option for -Os compilation

From: Martin J. Bligh
Date: Mon Sep 15 2003 - 10:17:02 EST


--Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> wrote (on Sunday, September 14, 2003 15:57:49 +0100):

> On Sul, 2003-09-14 at 14:53, Wade wrote:
>> Adrian Bunk wrote:
>> > The patch below adds a config option OPTIMIZE_FOR_SIZE for telling gcc
>> > to use -Os instead of -O2. Besides this, it removes constructs on
>> > architectures that had a -Os hardcoded in their Makefiles.
>>
>> Someone told me that -Os is actually faster than -O2 for Athlons, is
>> that true?
>
> On gcc 2.95 -Os was faster for most stuff. I would intuitively expect
> the best result to be a mix varied by function but I don't think gcc has
> the support to do that.
>
> I've also not benched gcc 3.2 -Os v -O2 at real workloads - thats a
> nice little project for someone.

I think it depends heavily on the chip - I tried 2.95 and 3.3. For me,
-Os was slower for both, but I have a 2MB L2 cache. If you have a 128K
celeron or something, I'm sure it'd be faster.

M.

-
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/