Coalesce object-code identical dtor, template, etc. ?

Karl M. Hegbloom hegbloom@pdx.edu
Tue Jun 3 18:49:00 GMT 2003


When I use a template instantiated with a pointer to type, or when more
than one automaticly generated function is created...  The object code I
see when I compile it with "-S" often has several functions in it that
are _identical_, instruction for instruction, other than their jump
label, which only "really" exists in the compiler/assembler, not at
runtime.  I think that a good optimization would be to detect that, and
just write two labels and one function.  This will reduce the object
binary size, perhaps considerably.  Also, can the linker do this as
well?

Q: Are there pre-compiled STL data types instantiated with
pointer-to-type that could be reused in the above fashion?

-- 
Karl M. Hegbloom <hegbloom@pdx.edu>



More information about the Gcc-bugs mailing list