pr middle-end/23237
authorjconner <jconner@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Sep 2005 15:46:35 +0000 (15:46 +0000)
committerjconner <jconner@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Sep 2005 15:46:35 +0000 (15:46 +0000)
    * ipa-reference.c (static_execute): Don't mark variables in
    named sections TREE_READONLY.

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

gcc/ChangeLog
gcc/ipa-reference.c

index 6e9bfe4..36dedc7 100644 (file)
@@ -1,3 +1,9 @@
+2005-09-12  Josh Conner  <jconner@apple.com>
+
+       PR middle-end/23237
+       * ipa-reference.c (static_execute): Don't mark variables in
+       named sections TREE_READONLY.
+
 2005-09-12  Alan Modra  <amodra@bigpond.net.au>
 
        * config/rs6000/rs6000.c (get_next_active_insn): Simplify test for
index f2f9252..5317052 100644 (file)
@@ -963,10 +963,17 @@ static_execute (void)
     EXECUTE_IF_SET_IN_BITMAP (module_statics_readonly, 0, index, bi)
       {
        tree var = get_static_decl (index);
-       TREE_READONLY (var) = 1;
-       if (dump_file)
-         fprintf (dump_file, "read-only var %s\n", 
-                  get_static_name (index)); 
+
+       /* Ignore variables in named sections - changing TREE_READONLY
+          changes the section flags, potentially causing conflicts with
+          other variables in the same named section.  */
+       if (DECL_SECTION_NAME (var) == NULL_TREE)
+         {
+           TREE_READONLY (var) = 1;
+           if (dump_file)
+             fprintf (dump_file, "read-only var %s\n", 
+                      get_static_name (index));
+         }
        if (DECL_INITIAL (var)
            && is_gimple_min_invariant (DECL_INITIAL (var)))
          {