Fw: [PATCH][RFC] CC_OPTIMIZE_FOR_SIZE should default to N
Paul E. McKenney
paulmck at linux.vnet.ibm.com
Thu Mar 10 07:24:32 UTC 2011
On Tue, Mar 08, 2011 at 09:07:10AM +1300, Michael Hope wrote:
> On Tue, Mar 8, 2011 at 8:47 AM, Tom Gall <tom.gall at linaro.org> wrote:
> > To quote the GCC manual:
> > -Os
> > Optimize for size. -Os enables all -O2 optimizations that do not
> > typically increase code size. It also performs further optimizations
> > designed to reduce code size.
> > -Os disables the following optimization flags:
> > -falign-functions -falign-jumps -falign-loops
> > -falign-labels -freorder-blocks -freorder-blocks-and-partition
> > -fprefetch-loop-arrays -ftree-vect-loop-version
> > That said (and unless there's other undocumented differences), it
> > would seem to take some expertise to comment on the trade off between
> > memory efforts (cache misses, TLB etc) vs instructional effects by
> > having these optimizations off.
> > I am certainly not that expert but I suspect given the memory bus
> > speeds that typical arm hardware has, we'd want -Os over -O2.
> I don't know about the kernel, but here's the difference for some
> other programs:
> * pybench: -Os is 24 % slower than -O2
> * skia: -Os is 18 % slower than -O2
> * CoreMark is similar (I've lost the numbers)
> ...so you're going to need a large bandwidth saving to beat the core
> speed improvement of -O2.
So no objections to Jesper Juhl's proposal to make -Os not be default,
More information about the linaro-dev