aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2003-09-08 09:54:13 -0700
committerRichard Henderson <rth@gcc.gnu.org>2003-09-08 09:54:13 -0700
commitc4bb110a19d441dbaef58fe4215bda6537e5c8a4 (patch)
tree2a429372d91b62de9e98aba3487e9646fdd7a88c
parentf23fb7f5252c3cb2f551d66c0887e2232f10736d (diff)
downloadgcc-c4bb110a19d441dbaef58fe4215bda6537e5c8a4.zip
gcc-c4bb110a19d441dbaef58fe4215bda6537e5c8a4.tar.gz
gcc-c4bb110a19d441dbaef58fe4215bda6537e5c8a4.tar.bz2
* optimize.c (maybe_clone_body): Inc/dec function_depth.
From-SVN: r71210
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/optimize.c7
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b3a27e8..13a5c55 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index bcb74e4..3204311 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -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;
}