Patchwork Spec DECL_VISIBILITY_SPECIFIED for whopr partitioning

login
register
mail settings
Submitter Jan Hubicka
Date Sept. 7, 2010, 2:28 p.m.
Message ID <20100907142806.GE21528@kam.mff.cuni.cz>
Download mbox | patch
Permalink /patch/64025/
State New
Headers show

Comments

Jan Hubicka - Sept. 7, 2010, 2:28 p.m.
Hi,
unless DECL_VISIBILITY_SPECIFIED is set, we ignore visibilities for external symbols
(to make -fvisibility work). 

Setting the flag in WHOPR partitioning makes locally_bound_p and friends to trust
the visibility and improves PIC codegen.

Boostrapped/regtested x86_64-linux, OK?

Honza

	* lto/lto.c (promote_var): Set DECL_VISIBILITY_SPECIFIED.
Diego Novillo - Sept. 7, 2010, 3:32 p.m.
On Tue, Sep 7, 2010 at 10:28, Jan Hubicka <hubicka@ucw.cz> wrote:

>        * lto/lto.c (promote_var): Set DECL_VISIBILITY_SPECIFIED.

OK.


Diego.

Patch

Index: lto/lto.c
===================================================================
--- lto/lto.c	(revision 163947)
+++ lto/lto.c	(working copy)
@@ -914,6 +914,7 @@  promote_var (struct varpool_node *vnode)
   gcc_assert (flag_wpa);
   TREE_PUBLIC (vnode->decl) = 1;
   DECL_VISIBILITY (vnode->decl) = VISIBILITY_HIDDEN;
+  DECL_VISIBILITY_SPECIFIED (vnode->decl) = true;
   if (cgraph_dump_file)
     fprintf (cgraph_dump_file,
 	    "Promoting var as hidden: %s\n", varpool_node_name (vnode));
@@ -930,6 +931,7 @@  promote_fn (struct cgraph_node *node)
     return false;
   TREE_PUBLIC (node->decl) = 1;
   DECL_VISIBILITY (node->decl) = VISIBILITY_HIDDEN;
+  DECL_VISIBILITY_SPECIFIED (node->decl) = true;
   if (node->same_body)
     {
       struct cgraph_node *alias;
@@ -938,6 +940,7 @@  promote_fn (struct cgraph_node *node)
 	{
 	  TREE_PUBLIC (alias->decl) = 1;
 	  DECL_VISIBILITY (alias->decl) = VISIBILITY_HIDDEN;
+	  DECL_VISIBILITY_SPECIFIED (alias->decl) = true;
 	}
     }
   if (cgraph_dump_file)