OSDN Git Service

* optimize.c (maybe_clone_body): Inc/dec function_depth.
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Sep 2003 16:54:13 +0000 (16:54 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Sep 2003 16:54:13 +0000 (16:54 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71210 138bc75d-0d04-0410-961f-82ee72b054a4

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

index b3a27e8..13a5c55 100644 (file)
@@ -6,6 +6,10 @@
 
 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.
        * decl2.c (mark_used): Don't push/pop gc context.
        * optimize.c (optimize_function): Likewise.
index bcb74e4..3204311 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;
 }