aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>1999-09-09 20:16:49 -0700
committerRichard Henderson <rth@gcc.gnu.org>1999-09-09 20:16:49 -0700
commitf4e5c65b060c18ea208bb12ec72f936827ab859b (patch)
tree9ffc01c1b2a2946921e1d0edd9595558de9cd0ef /gcc/c-decl.c
parentf74c0f9107a13996bec150566cca6ee96a34f365 (diff)
downloadgcc-f4e5c65b060c18ea208bb12ec72f936827ab859b.zip
gcc-f4e5c65b060c18ea208bb12ec72f936827ab859b.tar.gz
gcc-f4e5c65b060c18ea208bb12ec72f936827ab859b.tar.bz2
c-decl.c (finish_function): When processing a nested function...
* c-decl.c (finish_function): When processing a nested function, push and pop GC context around rest_of_compilation. From-SVN: r29255
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 1acb160..33c0042 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -6928,9 +6928,18 @@ finish_function (nested)
/* So we can tell if jump_optimize sets it to 1. */
can_reach_end = 0;
+ /* If this is a nested function, protect the local variables in the stack
+ above us from being collected while we're compiling this function. */
+ if (ggc_p && nested)
+ ggc_push_context ();
+
/* Run the optimizers and output the assembler code for this function. */
rest_of_compilation (fndecl);
+ /* Undo the GC context switch. */
+ if (ggc_p && nested)
+ ggc_pop_context ();
+
current_function_returns_null |= can_reach_end;
if (warn_missing_noreturn