* optimize.c (maybe_clone_body): Inc/dec function_depth.
authorRichard Henderson <rth@redhat.com>
Mon, 8 Sep 2003 16:54:13 +0000 (09:54 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Mon, 8 Sep 2003 16:54:13 +0000 (09:54 -0700)
From-SVN: r71210

gcc/cp/ChangeLog
gcc/cp/optimize.c

index b3a27e89ef5ab38f461e71bdf5e4c2573fb9a4c5..13a5c55a718a4c0a1b49bc253d3806f0ff46491f 100644 (file)
@@ -4,6 +4,10 @@
        * pt.c (try_one_overload): Add addr_p parameter.
        (resolve_overloaded_unification): Pass it.
 
+2003-09-08  Richard Henderson  <rth@redhat.com>
+
+       * optimize.c (maybe_clone_body): Inc/dec function_depth.
+
 2003-09-08  Richard Henderson  <rth@redhat.com>
 
        * decl.c (finish_function): Clear current_function_decl.
index bcb74e4917f9d0f7a544fe3467de51b194fca21a..3204311ea7de65b439d1301fc80c0a7cde159df7 100644 (file)
@@ -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);
@@ -253,6 +258,8 @@ maybe_clone_body (tree fn)
       pop_from_top_level ();
     }
 
+  function_depth--;
+
   /* We don't need to process the original function any further.  */
   return 1;
 }