* varasm.c (restore_varasm_status): New.
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Oct 2001 16:46:24 +0000 (16:46 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Oct 2001 16:46:24 +0000 (16:46 +0000)
        * function.h: Declare it.
        * function.c (pop_function_context_from): Call it.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46080 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 353151b..182fd9c 100644 (file)
@@ -1,5 +1,11 @@
 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.
        * c-tree.h (DECL_DECLARED_INLINE_P): New.
        * c-lang.c (c_disregard_inline_limits): Use it.
index fed2b3b..086fdc6 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 8eeda3a..c441960 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 b2ce9a6..d2a59d8 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