Disabling inlining entirely saves 400+ bytes...

Rob Landley rob at landley.net
Tue Jun 20 08:19:30 PDT 2006


On Tuesday 20 June 2006 12:46 am, Andre wrote:
> --- Rob Landley <rob at landley.net> wrote:
> > This is pretty nice on gcc 4.0.3:
> >
> > --- Rules.mak   (revision 15420)
> > +++ Rules.mak   (working copy)
> > @@ -196,6 +196,7 @@
> >  CHECKED_CFLAGS+=$(call check_cc,$(CC),-funsigned-char,)
> >  CHECKED_CFLAGS+=$(call check_cc,$(CC),-mmax-stack-frame=256,)
> >  CHECKED_CFLAGS+=$(call check_cc,$(CC),-fno-builtin-strlen)
> > +CHECKED_CFLAGS+=$(call check_cc,$(CC),-finline-limit=0)
> >
> > Anybody opinions?
>
> How many combinations of inline-limit and $ARCH did you try ??

A dozen or so, but considering the man page says the default is 600 (which, as 
far as I can tell, is completely wrong) it was mostly larger numbers.  I 
didn't try anything between 50 and 0.

> -Os -finline-functions -finline-limit=10
>
> used to give the smallest code for ARM in Thumb mode with gcc 3.4.4
> last time I tried experimenting with such options... (but seems not
> to make a difference anymore with gcc 4.x).

Small inlines are in theory a win if they prevent unnecessary register 
shuffling.  The knobs we have to work with here are fiddly and obscure, 
though.  And I don't want to be too compiler version specific.  "Switch this 
off entirely" is at least somewhat portable as a concept...

Rob
-- 
Never bet against the cheap plastic solution.


More information about the busybox mailing list