This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: empty function optimizations
- To: martin at loewis dot home dot cs dot tu-berlin dot de (Martin v. Loewis)
- Subject: Re: empty function optimizations
- From: Joe Buck <jbuck at racerx dot synopsys dot com>
- Date: Wed, 12 Jul 2000 15:44:26 -0700 (PDT)
- Cc: mark at codesourcery dot com, amylaar at cygnus dot co dot uk, ken at gesn dot com, gcc at gcc dot gnu dot org
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.