varasm.c (restore_varasm_status): New.
authorRichard Henderson <rth@redhat.com>
Mon, 8 Oct 2001 16:46:24 +0000 (09:46 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Mon, 8 Oct 2001 16:46:24 +0000 (09:46 -0700)
        * varasm.c (restore_varasm_status): New.
        * function.h: Declare it.
        * function.c (pop_function_context_from): Call it.

From-SVN: r46080

gcc/ChangeLog
gcc/function.c
gcc/function.h
gcc/varasm.c

index 353151bb3a5b06d34d1ad081f4fa7f215a66e2be..182fd9c931dbeceaa9c511bad9b51919b737b639 100644 (file)
@@ -1,3 +1,9 @@
+2001-10-08  Richard Henderson  <rth@redhat.com>
+
+       * varasm.c (restore_varasm_status): New.
+       * function.h: Declare it.
+       * function.c (pop_function_context_from): Call it.
+
 2001-10-08  Richard Henderson  <rth@redhat.com>
 
        * c-common.h (struct c_lang_decl): Add declared_inline.
index fed2b3b68c7453fbb8c9ba23ea47ff44373ef101..086fdc69d6f0e3c3471952dbe75babfc1d6523bf 100644 (file)
@@ -386,6 +386,7 @@ pop_function_context_from (context)
   reg_renumber = 0;
 
   restore_emit_status (p);
+  restore_varasm_status (p);
 
   if (restore_lang_status)
     (*restore_lang_status) (p);
index 8eeda3a290226eabce38ca4e4b6e3448a55d1b4d..c4419604d740df31b303c6972bee2c98ec59ead3 100644 (file)
@@ -592,6 +592,7 @@ extern void free_after_parsing              PARAMS ((struct function *));
 extern void free_after_compilation     PARAMS ((struct function *));
 
 extern void init_varasm_status         PARAMS ((struct function *));
+extern void restore_varasm_status      PARAMS ((struct function *));
 extern void free_varasm_status         PARAMS ((struct function *));
 extern void free_emit_status           PARAMS ((struct function *));
 extern void free_stmt_status            PARAMS ((struct function *));
index b2ce9a6de8f9e0fe2d08f059713772383964c975..d2a59d8e43e1dcc8fe9fbf97a1cb52fac97c449a 100644 (file)
@@ -3493,6 +3493,23 @@ init_varasm_status (f)
   p->x_const_double_chain = 0;
 }
 
+/* Nested functions diddle with our const_double_chain via
+   clear_const_double_mem and const_tiny_rtx.  Remove these
+   entries from our const_double_chain.  */
+
+void
+restore_varasm_status (f)
+     struct function *f;
+{
+  rtx *p = &f->varasm->x_const_double_chain;
+
+  while (*p)
+    if (CONST_DOUBLE_MEM (*p) == cc0_rtx)
+      *p = CONST_DOUBLE_CHAIN (*p);
+    else
+      p = &CONST_DOUBLE_CHAIN (*p);
+}
+
 /* Mark PC for GC.  */
 
 static void