[WIP] Remove nested function in elf/dl-lookup.c? (Nested functions considered harmful?)
Mike Frysinger
vapier@gentoo.org
Mon Dec 16 17:03:00 GMT 2013
On Monday 16 December 2013 11:12:09 Carlos O'Donell wrote:
> On 12/16/2013 09:40 AM, Siddhesh Poyarekar wrote:
> > On Mon, Dec 16, 2013 at 09:32:12AM -0500, Carlos O'Donell wrote:
> >> Maybe, maybe not, but that would be a distinct patch *after*
> >> this initial checkin to make the function distinct.
> >>
> >> I don't want to wrap the elements in a struct because that
> >> breaks the optimizations used during inlining.
> >
> > Yeah, making a struct out of it is pointless. We could clean up the
> > arguments later.
>
> It's not entirely pointless. A pointer to a structure makes the call
> optimal when the ABI requires pass by stack, you need only push a
> single register, and pop a single register before doing register+offset
> loads.
but you still need to create the struct on the stack unless gcc is super
intelligent and lays out the local vars in such a way that it also matches the
struct layout. but that seems pretty fragile to rely upon.
> One question I had was: Why is the original function
> __attribute_noinline__?
the original commit that added this:
commit 021723ab784461de9eac57398ea16a47d4ab9366
Author: Ulrich Drepper <drepper@redhat.com>
Date: Sun Mar 7 05:26:02 2004 +0000
Update.
and the actual diff doesn't indicate a compelling reason.
have i mentioned i fsckin hate the glibc commit history ? current history
sometimes isn't too much better.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20131216/5cea34ef/attachment.sig>
More information about the Libc-alpha
mailing list