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]

Re: empty function optimizations


Mark writes:
> > Other than that, we can't change the mangling, even if it's buggy
> > with respect to the spec, or even if information required for
> > demangling is missing.

Martin writes:
> I absolutely agree. As a result, Joe is right that any code reduction
> must come from factorizing the library code itself, using standard C++
> techniques, for practical purposes. Still, it may be possible to
> achieve code reduction by combining functionally-equivalent
> instantiations by means of an extension to the ABI, e.g. by placing
> multiple symbols in front of identical assembler code.

The standard ABI would not be violated if, when generating the
implementation of two templates that can share identical code, we emit the
code once with two labels, and all code we generate that calls
either template uses the appropriate label.  The code would be
interoperable with another compiler than generates a separate expansion
for each function.

There's the matter of comparing function pointers, but that could be
solved by thunks or nops or something.

But I'm not convinced it's worth anyone's time to do it.



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