(finish_decl): After preserve_initializer call, set
authorRichard Stallman <rms@gnu.org>
Tue, 19 Oct 1993 03:19:18 +0000 (03:19 +0000)
committerRichard Stallman <rms@gnu.org>
Tue, 19 Oct 1993 03:19:18 +0000 (03:19 +0000)
TREE_PERMANENT bit in initializer.

From-SVN: r5800

gcc/c-decl.c

index f8a52a31e462be0f82535fc4605df7dc2b153211..888f9be676eca51e5a177179eb155d8a9d5c0da3 100644 (file)
@@ -3565,7 +3565,14 @@ finish_decl (decl, init, asmspec_tree)
             initializer instead of discarding it so that we can optimize
             references to it.  */
          if (TREE_STATIC (decl) && TREE_READONLY (decl))
-           preserve_initializer ();
+           {
+             preserve_initializer ();
+             /* Hack?  Set the permanent bit for something that is permanent,
+                but not on the permenent obstack, so as to convince
+                output_constant_def to make its rtl on the permanent
+                obstack.  */
+             TREE_PERMANENT (DECL_INITIAL (decl)) = 1;
+           }
          else
            DECL_INITIAL (decl) = error_mark_node;
        }