diff options
author | Richard Henderson <rth@cygnus.com> | 1999-09-09 20:16:49 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 1999-09-09 20:16:49 -0700 |
commit | f4e5c65b060c18ea208bb12ec72f936827ab859b (patch) | |
tree | 9ffc01c1b2a2946921e1d0edd9595558de9cd0ef /gcc/c-decl.c | |
parent | f74c0f9107a13996bec150566cca6ee96a34f365 (diff) | |
download | gcc-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.c | 9 |
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 |