]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
lto-cgraph.c (lto_output_varpool_node): Always output constant pool references.
authorJan Hubicka <jh@suse.cz>
Fri, 30 Apr 2010 14:26:51 +0000 (16:26 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 30 Apr 2010 14:26:51 +0000 (14:26 +0000)
* lto-cgraph.c (lto_output_varpool_node): Always output constant pool
references.

* lto.c: Do not attempt to make constant pool references global.

From-SVN: r158938

gcc/ChangeLog
gcc/lto-cgraph.c
gcc/lto/ChangeLog
gcc/lto/lto.c

index a2117040071cfd99e3667aabc4d65a6c80f82d78..a5f8d09513dd934db485e77b4e88cf22d270edac 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-30  Jan Hubicka  <jh@suse.cz>
+
+       * lto-cgraph.c (lto_output_varpool_node): Always output constant pool
+       references.
+
 2010-04-30  Jan Hubicka  <jh@suse.cz>
 
        * tree-profile.c (tree_init_ic_make_global_vars): Mark new decls as
index 338250aeb0dfcb59f8c703a661241d42a43d5802..8a8855a70c14803a7eed3d9c7009e4537634cd74 100644 (file)
@@ -374,10 +374,21 @@ lto_output_varpool_node (struct lto_simple_output_block *ob, struct varpool_node
   gcc_assert (node->finalized || !node->analyzed);
   gcc_assert (node->needed);
   gcc_assert (!node->alias);
-  /* FIXME: We have no idea how we move references around.  For moment assume that
-     everything is used externally.  */
-  bp_pack_value (bp, flag_wpa, 1);  /* used_from_other_parition.  */
-  bp_pack_value (bp, boundary_p, 1);  /* in_other_partition.  */
+  /* Constant pool initializers can be de-unified into individual ltrans units.
+     FIXME: Alternatively at -Os we may want to avoid generating for them the local
+     labels and share them across LTRANS partitions.  */
+  if (DECL_IN_CONSTANT_POOL (node->decl))
+    {
+      bp_pack_value (bp, 0, 1);  /* used_from_other_parition.  */
+      bp_pack_value (bp, 0, 1);  /* in_other_partition.  */
+    }
+  else
+    {
+      /* FIXME: We have no idea how we move references around.  For moment assume that
+        everything is used externally.  */
+      bp_pack_value (bp, flag_wpa, 1);  /* used_from_other_parition.  */
+      bp_pack_value (bp, boundary_p, 1);  /* in_other_partition.  */
+    }
   /* Also emit any extra name aliases.  */
   for (alias = node->extra_name; alias; alias = alias->next)
     count++;
index 52663e75078ed2b3fc17b2bbe18fb58a1eb9630c..78452a759b2066d26b04040a191c3baae482aaca 100644 (file)
@@ -1,3 +1,7 @@
+2010-04-30  Jan Hubicka  <jh@suse.cz>
+
+       * lto.c: Do not attempt to make constant pool references global.
+
 2010-04-28  Jan Hubicka  <jh@suse.cz>
 
        * lto/lto.c (lto_read_in_decl_state): Use GGC.
index ae3d90eaf4cb1492377271cf7ceee70cfab59bc5..18fef05317d6409a5844271f1efed2964040a9d7 100644 (file)
@@ -723,9 +723,13 @@ lto_promote_cross_file_statics (void)
   gcc_assert (flag_wpa);
 
   /* At moment we make no attempt to figure out who is refering the variables,
-     so all must become global.  */
+     so all must become global.  
+
+     Constant pool references use internal labels and thus can not be made global.
+     It is sensible to keep those ltrans local to allow better optimization.  */
   for (vnode = varpool_nodes; vnode; vnode = vnode->next)
-    if (!vnode->externally_visible && vnode->analyzed)
+    if (!vnode->externally_visible && vnode->analyzed
+       && !DECL_IN_CONSTANT_POOL (vnode->decl))
        {
          TREE_PUBLIC (vnode->decl) = 1;
          DECL_VISIBILITY (vnode->decl) = VISIBILITY_HIDDEN;