* symtab.c (symtab_nonoverwritable_alias): Copy READONLY flag for variables.
authorJan Hubicka <hubicka@ucw.cz>
Mon, 26 May 2014 00:50:24 +0000 (02:50 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Mon, 26 May 2014 00:50:24 +0000 (00:50 +0000)
From-SVN: r210919

gcc/ChangeLog
gcc/symtab.c

index 8a5ff8f..c8b1a3f 100644 (file)
@@ -1,5 +1,9 @@
 2014-05-23  Jan Hubicka  <hubicka@ucw.cz>
 
+       * symtab.c (symtab_nonoverwritable_alias): Copy READONLY flag for variables.
+
+2014-05-23  Jan Hubicka  <hubicka@ucw.cz>
+
        * ipa-visibility.c (can_replace_by_local_alias_in_vtable): New function.
        (update_vtable_references): New function.
        (function_and_variable_visibility): Rewrite also vtable initializers.
index 301f7e3..8abb7a1 100644 (file)
@@ -1163,9 +1163,13 @@ symtab_nonoverwritable_alias (symtab_node *node)
                                 (new_decl, node->decl);
     }
   else
-    new_node = varpool_create_variable_alias (new_decl, node->decl);
+    {
+      TREE_READONLY (new_decl) = TREE_READONLY (node->decl);
+      new_node = varpool_create_variable_alias (new_decl, node->decl);
+    }
   symtab_resolve_alias (new_node, node);  
-  gcc_assert (decl_binds_to_current_def_p (new_decl));
+  gcc_assert (decl_binds_to_current_def_p (new_decl)
+             && targetm.binds_local_p (new_decl));
   return new_node;
 }