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]

Re: fix collected c++ gc regressions


On Mon, Sep 08, 2003 at 09:04:58AM -0700, Richard Henderson wrote:
> FAIL: g++.dg/init/new6.C (test for excess errors)

The different point about this testcase is -fkeep-inline-functions,
which results in recursion as short as

#3  0x080d58a8 in expand_body (fn=0x4029c510)
    at ../../../src-gcc/gcc/cp/semantics.c:2871
#4  0x080d5b94 in expand_or_defer_fn (fn=0x4029c510)
    at ../../../src-gcc/gcc/cp/semantics.c:2992
#5  0x080db959 in maybe_clone_body (fn=0x4029bd80)
    at ../../../src-gcc/gcc/cp/optimize.c:252
#6  0x080d59a6 in expand_or_defer_fn (fn=0x4029bd80)
    at ../../../src-gcc/gcc/cp/semantics.c:2924


r~


        * optimize.c (maybe_clone_body): Inc/dec function_depth.

Index: optimize.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/optimize.c,v
retrieving revision 1.97
diff -u -p -r1.97 optimize.c
--- optimize.c	8 Sep 2003 15:56:26 -0000	1.97
+++ optimize.c	8 Sep 2003 16:45:59 -0000
@@ -130,6 +130,11 @@ maybe_clone_body (tree fn)
   /* Emit the DWARF1 abstract instance.  */
   (*debug_hooks->deferred_inline_function) (fn);
 
+  /* Our caller does not expect collection to happen, which it might if
+     we decide to compile the function to rtl now.  Arrange for a new
+     gc context to be created if so.  */
+  function_depth++;
+
   /* We know that any clones immediately follow FN in the TYPE_METHODS
      list.  */
   for (clone = TREE_CHAIN (fn);
@@ -252,6 +257,8 @@ maybe_clone_body (tree fn)
       expand_or_defer_fn (clone);
       pop_from_top_level ();
     }
+
+  function_depth--;
 
   /* We don't need to process the original function any further.  */
   return 1;


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