This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: empty function optimizations
- To: jbuck at racerx dot synopsys dot com
- Subject: Re: empty function optimizations
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Wed, 12 Jul 2000 21:03:17 +0200
- CC: ken at gesn dot com, gcc at gcc dot gnu dot org
- References: <200007120246.TAA19814@racerx.synopsys.com>
> I agree with you that this is a problem, but believe that the appropriate
> fix isn't in the linker, but is to improve STL instead to use partial
> specialization. The results would be better than you would be able to
> get by trying to use the linker to remove duplicate code.
I personally believe that the right fix is in the compiler, which
should statically determine that instantiations don't depend on the
some template parameters, and mangle the function names with a
wildcard. Different instantiations would then still get the same
assembler name. The compiler would avoid emitting duplicate
instantiations of functionally-equivalent code, and the linker would
remove duplicates as it does today.
The tricky part, of course, is to define the exact mechanism for
determining independence from template parameters.
Regards,
Martin