This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Merging identical functions in GCC


On Sep 20, 2006, Joe Buck <Joe.Buck@synopsys.COM> wrote:

> On Wed, Sep 20, 2006 at 02:52:40AM -0300, Alexandre Oliva wrote:

>> For extra bonus points, it may short-circuit relocations that call foo
>> (as opposed to taking its address) when it binds locally and skip the
>> jmp altogether.  Ditto for *all* relocations that reference foo, when
>> it doesn't merge .foo.impl with anything else.

> Alternatively, the compiler could arrange that pointers to functions always
> point to a jump that then leads to the function, while direct calls
> go directly to the function.  That way pointers compare unequal
> but the code is merged.

Yeah, that works too, it's like function descriptors on the IA64,
PPC64 and FRV-FDPIC ABIs.

-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Secretary for FSF Latin America        http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]