This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[C++ PATCH] Fix one of the recently introduced regressions


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,

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]