aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/optimize.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/optimize.c')
-rw-r--r--gcc/cp/optimize.c7
1 files changed, 7 insertions, 0 deletions
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;
}