This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: template functions not inlined
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Dan Nicolaescu <dann at ics dot uci dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 1 Feb 2004 13:01:30 +0100
- Subject: Re: template functions not inlined
- References: <200402010443.i114hhSn010319@gremlin.ics.uci.edu>
>
> The following trivial example shows that template functions defined at
> the top level are not inlined by any version of gcc.
>
> template<typename T> int func (T t) { return 25; }
> void bar(void) { func (17); }
>
> Intel's compiler inlines func into bar.
>
> Dan Berlin investigated this a bit, and the cause is
> cp/tree.c:2058-2064 which in turn is caused by varasm.c:4909
> Is there any reason for that code to be the right thing to do
> for the above example?
http://gcc.gnu.org/ml/gcc-patches/2004-02/msg00011.html :)
Honza