On Mon, 25 Jun 2007, Segher Boessenkool wrote:
In my experience, -Os produced faster code on gcc-2.95 than -O2 or -O3.On what CPU? The effect of different optimisations varies hugely between different CPUs (and architectures).It was not only because of cache considerations, but because gcc used different tricks to avoid poor optimizations, and at the end, the CPU ended executing the alternative code faster.-Os is "as fast as you can without bloating the code size", so that is the expected result for CPUs that don't need special hand-holding around certain performance pitfalls.
this sounds like you are saying that people wanting performance should pick -Os.
what should people pick who care more about code size then anything else? (examples being embedded development where you may be willing to sacrafice speed to avoid having to add additional chips to the design)
David Lang - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: -Os versus -O2
- From: Segher Boessenkool <[email protected]>
- Re: -Os versus -O2
- References:
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- From: Arjan van de Ven <[email protected]>
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- From: Benjamin LaHaise <[email protected]>
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- From: Arjan van de Ven <[email protected]>
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- From: Benjamin LaHaise <[email protected]>
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- From: Arjan van de Ven <[email protected]>
- -Os versus -O2
- From: Adrian Bunk <[email protected]>
- Re: -Os versus -O2
- From: Arjan van de Ven <[email protected]>
- Re: -Os versus -O2
- From: [email protected]
- Re: -Os versus -O2
- From: Arjan van de Ven <[email protected]>
- Re: -Os versus -O2
- From: [email protected]
- Re: -Os versus -O2
- From: Willy Tarreau <[email protected]>
- Re: -Os versus -O2
- From: Segher Boessenkool <[email protected]>
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- Prev by Date: Re: -Os versus -O2
- Next by Date: Re: [RFC] fsblock
- Previous by thread: Re: -Os versus -O2
- Next by thread: Re: -Os versus -O2
- Index(es):