Merging identical functions in GCC
Daniel Berlin
dberlin@dberlin.org
Fri Sep 15 18:46:00 GMT 2006
On 9/15/06, Laurent GUERBY <laurent@guerby.net> wrote:
> On Fri, 2006-09-15 at 09:27 -0700, Ian Lance Taylor wrote:
> > I think Danny has a 75% implementation based on hashing the RTL for a
> > section and using that to select the COMDAT section signature. Or the
> > hashing can be done in the linker, but it still needs compiler help to
> > know when it is permissible.
>
> For code sections (I assume read-only), isn't the linker always able to
> merge identical ones? What can the compiler do better than the linker?
The linker doesn't know what the code does. The compiler does.
Therefore, the compiler always can do a better job, as it can
correctly identify more things as doing the same thing.
--Dan
More information about the Gcc
mailing list