This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: empty function optimizations
- To: amylaar at cygnus dot co dot uk (Joern Rennecke)
- Subject: Re: empty function optimizations
- From: Joe Buck <jbuck at racerx dot synopsys dot com>
- Date: Tue, 11 Jul 2000 15:41:12 -0700 (PDT)
- Cc: ken at gesn dot com (Ken Clark), gcc at gcc dot gnu dot org
> > Some conforming programs would break, but these are fairly obscure (e.g.
> > programs that compare function pointers). Debugging might get harder.
> > But if you factor out common code, you can get greater savings than the
> > compiler can find and your gains are portable.
>
> How about especially marking function references that are function
> calls (the SH already does this for linker relaxation) ?
> We could then factor out common code if all references to a function
> are for a function call.
This may be feasible. There's also the matter of thunks, which may
complicate the picture: thunks may be jumps rather than function calls.
But by "factor out common code" I was talking about the C++ source level:
have templated class libraries attempt (with partial specialization and
similar techniques) to generate common code once, rather than asking for a
link-time pass to clean it up. STL has lots of candidates for such
factoring-out; for example, libstdc++ could contain pre-instantiated code
that would be used for much of vector<T> for the case where T is a PODS
without loss of efficiency.