This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[3.4, C++] PR 14950
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, mark at codesourcery dot com
- Date: Thu, 17 Jun 2004 22:35:15 +0200
- Subject: [3.4, C++] PR 14950
Hi,
after all this problem is not that dificult to fix. C++ frontend manages to
instantiate template before emmiting it but it mistakely keeps
TI_PENDING_TEMPLATE_FLAG on that makes C++ frontend to think that it should
prohibit inlining here.
Clearing the flag slightly easier appears to do the trick.
Bootstrapped/regtested ia64-linux
OK? (I would like to install it into mainline too even tought the testcase does
not reproduce there as this interference might hit us in other scenario too)
template <class T> inline void Foo(T) __attribute__((always_inline));
template <class T> inline void Foo(T) {}
int main()
{
int i;
Foo(i);
}
2004-06-17 Jan Hubicka <jh@suse.cz>
* pt.c (instantiate_decl): Clean TI_PENDING_TEMPLATE_FLAG before
expanding the function.
Index: cp/pt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/pt.c,v
retrieving revision 1.816.2.31
diff -c -3 -p -r1.816.2.31 pt.c
*** cp/pt.c 10 Jun 2004 18:30:57 -0000 1.816.2.31
--- cp/pt.c 17 Jun 2004 18:06:55 -0000
*************** instantiate_decl (tree d, int defer_ok)
*** 11241,11246 ****
--- 11241,11249 ----
/* Finish the function. */
d = finish_function (0);
+ /* Clear the flag now right now so we won't end up thinking that this
+ function is uninlinable. */
+ TI_PENDING_TEMPLATE_FLAG (DECL_TEMPLATE_INFO (d)) = 0;
expand_or_defer_fn (d);
}