[patch] save ~600B

Rob Landley rob at landley.net
Fri Jun 9 15:13:35 UTC 2006


On Thursday 08 June 2006 4:34 am, Bernhard Fischer wrote:

> >At some point in the future, gcc's build-at-once mode will grow the
> > ability to
>
> It may grow that ability or did i miss the discussion of a proposed
> patch which does teach gcc to do so?
>
> >merge duplicate strings.

Checking gcc's existing flags, -fmerge-constants is apparently supposed to 
already be enabled by -Os (either it's failing or it doesn't cross 
compilation units).  We could also try -fmerge-all-constants as a linker 
flag, to see if that helps.

> >And then we'll have to undo all this again.  But 
> > in the meantime, why not?
>
> I don't see why we would ever have to undo this. It's a sane thing to
> do, regardless of a future compiler eventually trying to get this right
> sometimes in the far, far future.

It's more complexity for something the compiler really should be doing for us.  
When you're looking at the code, you can't see what it's actually doing 
without looking at a second file.  (An opaque string, yet one we %s 
substitute into.)

I can sort of see this as a way of enforcing that the messages are indeed 
identical (although that traditionally would be an all-caps #define in a 
header file rather than a separate complication unit).  What we're doing 
right now seems extremely clumsy to me, I'm not quite putting my finger on 
why at the moment (it's before noon, don't ask me to think right now...)

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list