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 9/15/06, Ross Ridge <rridge@csclub.uwaterloo.ca> wrote:
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.

I don't think this is a good idea.  With different compiler options the
same RTL can generate different assembly instructions.  Consider the case
of compiling the same function multiple times with different names and
different CPU architectures selected.  You'd actually want the linker
to merge the functions that ended up having the same assembly, but not
the ones with the same RTL but different assembly.


So basically you are saying if you don't know what you are doing, or know you don't want to use it, you shouldn't be using it.

I'd agree with that :)

(The current hash actually takes into account compiler options as a
starting value for the hash, btw!)


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