From: Richard Henderson Date: Mon, 8 Sep 2003 16:54:13 +0000 (-0700) Subject: * optimize.c (maybe_clone_body): Inc/dec function_depth. X-Git-Tag: releases/gcc-3.4.0~3830 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c4bb110a19d441dbaef58fe4215bda6537e5c8a4;p=thirdparty%2Fgcc.git * optimize.c (maybe_clone_body): Inc/dec function_depth. From-SVN: r71210 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b3a27e89ef5a..13a5c55a718a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -4,6 +4,10 @@ * pt.c (try_one_overload): Add addr_p parameter. (resolve_overloaded_unification): Pass it. +2003-09-08 Richard Henderson + + * optimize.c (maybe_clone_body): Inc/dec function_depth. + 2003-09-08 Richard Henderson * decl.c (finish_function): Clear current_function_decl. diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c index bcb74e4917f9..3204311ea7de 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; }