This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ PATCH] Fix one of the recently introduced regressions
- From: Steven Bosscher <s dot bosscher at student dot tudelft dot nl>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 13 Sep 2003 02:09:51 +0200
- Subject: [C++ PATCH] Fix one of the recently introduced regressions
- References: <200309122214.h8CME9g35774@makai.watson.ibm.com> <1063406410.24901.485.camel@doubledemon.codesourcery.com> <20030912230018.GC17810@redhat.com>
Op za 13-09-2003, om 01:00 schreef Richard Henderson:
> I'm trying to reproduce these with a clean tree. I don't expect
> this will be difficult to track down.
I believe here's one part you need for the main1.C failure, which simply
aborts in cgraph_finalize_function without this patch, because
TREE_ASM_WRITTEN is set for the second function called "main()".
I think we shouldn't try to defer or expand function that have
TREE_ASM_WRITTEN set... Bootstrapped and regtested c++ on
i686-pc-linux-gnu, gives one FAIL less, 6 to go :) OK?
All the other new regressions all seem to be caused by one more bug.
Gr.
Steven
* semantics.c (expand_or_defer_fn): Don't try to expand or defer
functions that seem to have been written out already.
Index: semantics.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/semantics.c,v
retrieving revision 1.361
diff -c -3 -p -r1.361 semantics.c
*** semantics.c 11 Sep 2003 07:14:09 -0000 1.361
--- semantics.c 12 Sep 2003 23:52:24 -0000
*************** expand_body (tree fn)
*** 2897,2902 ****
--- 2897,2907 ----
void
expand_or_defer_fn (tree fn)
{
+ /* Don't try to expand or defer functions that are marked as if
+ they were expanded before. */
+ if (TREE_ASM_WRITTEN (fn))
+ return;
+
/* When the parser calls us after finishing the body of a template
function, we don't really want to expand the body. When we're
processing an in-class definition of an inline function,