]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c-decl.c (finish_function): When processing a nested function...
authorRichard Henderson <rth@cygnus.com>
Fri, 10 Sep 1999 03:16:49 +0000 (20:16 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Fri, 10 Sep 1999 03:16:49 +0000 (20:16 -0700)
        * c-decl.c (finish_function): When processing a nested function,
        push and pop GC context around rest_of_compilation.

From-SVN: r29255

gcc/ChangeLog
gcc/c-decl.c

index 04a97a3a56447cb46514c42548e53912f3e1d3e7..33f2df97aa0538e79a383fb4feb743bf0ec6e01d 100644 (file)
@@ -1,3 +1,8 @@
+Thu Sep  9 20:15:46 1999  Richard Henderson  <rth@cygnus.com>
+
+       * c-decl.c (finish_function): When processing a nested function,
+       push and pop GC context around rest_of_compilation.
+
 Thu Sep  9 16:42:06 1999  Richard Henderson  <rth@cygnus.com>
 
        * i386.c (override_options): Remove ppro, pentium2, and p2 as aliases.
index 1acb16012646f4de106d3e9ef6fb59455ccfdb28..33c004252ff0d7a8adb716c93b69185aa01d624d 100644 (file)
@@ -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