Commit 5ac42672 by Jan Hubicka Committed by Jan Hubicka

ipa.c (cgraph_externally_visible_p, [...]): Drop aliased parameter.

	* ipa.c (cgraph_externally_visible_p, varpool_externally_visible_p): Drop
	aliased parameter.
	(function_and_variable_visibility): Do not handle alias pairs.
	* cgraph.c (varpool_externally_visible_p): Update prototype.
	* varpool.c (varpool_add_new_variable): Update.

From-SVN: r197652
parent d74e340d
2013-04-09 Jan Hubicka <jh@suse.cz>
* ipa.c (cgraph_externally_visible_p, varpool_externally_visible_p): Drop
aliased parameter.
(function_and_variable_visibility): Do not handle alias pairs.
* cgraph.c (varpool_externally_visible_p): Update prototype.
* varpool.c (varpool_add_new_variable): Update.
2013-04-09 Kyrylo Tkachov <kyrylo.tkachov@arm.com> 2013-04-09 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/arm/arm.md (minmax_arithsi_non_canon): New pattern. * config/arm/arm.md (minmax_arithsi_non_canon): New pattern.
......
...@@ -726,7 +726,7 @@ void debug_varpool_node_set (varpool_node_set); ...@@ -726,7 +726,7 @@ void debug_varpool_node_set (varpool_node_set);
void free_varpool_node_set (varpool_node_set); void free_varpool_node_set (varpool_node_set);
void ipa_discover_readonly_nonaddressable_vars (void); void ipa_discover_readonly_nonaddressable_vars (void);
bool cgraph_comdat_can_be_unshared_p (struct cgraph_node *); bool cgraph_comdat_can_be_unshared_p (struct cgraph_node *);
bool varpool_externally_visible_p (struct varpool_node *, bool); bool varpool_externally_visible_p (struct varpool_node *);
/* In predict.c */ /* In predict.c */
bool cgraph_maybe_hot_edge_p (struct cgraph_edge *e); bool cgraph_maybe_hot_edge_p (struct cgraph_edge *e);
......
...@@ -573,7 +573,7 @@ cgraph_comdat_can_be_unshared_p (struct cgraph_node *node) ...@@ -573,7 +573,7 @@ cgraph_comdat_can_be_unshared_p (struct cgraph_node *node)
static bool static bool
cgraph_externally_visible_p (struct cgraph_node *node, cgraph_externally_visible_p (struct cgraph_node *node,
bool whole_program, bool aliased) bool whole_program)
{ {
if (!node->local.finalized) if (!node->local.finalized)
return false; return false;
...@@ -582,11 +582,6 @@ cgraph_externally_visible_p (struct cgraph_node *node, ...@@ -582,11 +582,6 @@ cgraph_externally_visible_p (struct cgraph_node *node,
|| DECL_EXTERNAL (node->symbol.decl))) || DECL_EXTERNAL (node->symbol.decl)))
return false; return false;
/* Do not even try to be smart about aliased nodes. Until we properly
represent everything by same body alias, these are just evil. */
if (aliased)
return true;
/* Do not try to localize built-in functions yet. One of problems is that we /* Do not try to localize built-in functions yet. One of problems is that we
end up mangling their asm for WHOPR that makes it impossible to call them end up mangling their asm for WHOPR that makes it impossible to call them
using the implicit built-in declarations anymore. Similarly this enables using the implicit built-in declarations anymore. Similarly this enables
...@@ -638,7 +633,7 @@ cgraph_externally_visible_p (struct cgraph_node *node, ...@@ -638,7 +633,7 @@ cgraph_externally_visible_p (struct cgraph_node *node,
/* Return true when variable VNODE should be considered externally visible. */ /* Return true when variable VNODE should be considered externally visible. */
bool bool
varpool_externally_visible_p (struct varpool_node *vnode, bool aliased) varpool_externally_visible_p (struct varpool_node *vnode)
{ {
/* Do not touch weakrefs; while they are not externally visible, /* Do not touch weakrefs; while they are not externally visible,
dropping their DECL_EXTERNAL flags confuse most dropping their DECL_EXTERNAL flags confuse most
...@@ -652,11 +647,6 @@ varpool_externally_visible_p (struct varpool_node *vnode, bool aliased) ...@@ -652,11 +647,6 @@ varpool_externally_visible_p (struct varpool_node *vnode, bool aliased)
if (!DECL_COMDAT (vnode->symbol.decl) && !TREE_PUBLIC (vnode->symbol.decl)) if (!DECL_COMDAT (vnode->symbol.decl) && !TREE_PUBLIC (vnode->symbol.decl))
return false; return false;
/* Do not even try to be smart about aliased nodes. Until we properly
represent everything by same body alias, these are just evil. */
if (aliased)
return true;
/* If linker counts on us, we must preserve the function. */ /* If linker counts on us, we must preserve the function. */
if (symtab_used_from_object_file_p ((symtab_node) vnode)) if (symtab_used_from_object_file_p ((symtab_node) vnode))
return true; return true;
...@@ -733,42 +723,9 @@ function_and_variable_visibility (bool whole_program) ...@@ -733,42 +723,9 @@ function_and_variable_visibility (bool whole_program)
{ {
struct cgraph_node *node; struct cgraph_node *node;
struct varpool_node *vnode; struct varpool_node *vnode;
struct pointer_set_t *aliased_nodes = pointer_set_create ();
struct pointer_set_t *aliased_vnodes = pointer_set_create ();
unsigned i;
alias_pair *p;
/* Discover aliased nodes. */ /* All aliases should be procssed at this point. */
FOR_EACH_VEC_SAFE_ELT (alias_pairs, i, p) gcc_checking_assert (!alias_pairs || !alias_pairs->length());
{
if (dump_file)
fprintf (dump_file, "Alias %s->%s",
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (p->decl)),
IDENTIFIER_POINTER (p->target));
if ((node = cgraph_node_for_asm (p->target)) != NULL
&& !DECL_EXTERNAL (node->symbol.decl))
{
if (!node->analyzed)
continue;
cgraph_mark_force_output_node (node);
pointer_set_insert (aliased_nodes, node);
if (dump_file)
fprintf (dump_file, " node %s/%i",
cgraph_node_name (node), node->uid);
}
else if ((vnode = varpool_node_for_asm (p->target)) != NULL
&& !DECL_EXTERNAL (vnode->symbol.decl))
{
vnode->symbol.force_output = 1;
pointer_set_insert (aliased_vnodes, vnode);
if (dump_file)
fprintf (dump_file, " varpool node %s",
varpool_node_name (vnode));
}
if (dump_file)
fprintf (dump_file, "\n");
}
FOR_EACH_FUNCTION (node) FOR_EACH_FUNCTION (node)
{ {
...@@ -817,9 +774,7 @@ function_and_variable_visibility (bool whole_program) ...@@ -817,9 +774,7 @@ function_and_variable_visibility (bool whole_program)
&& !DECL_COMDAT (node->symbol.decl)) && !DECL_COMDAT (node->symbol.decl))
|| TREE_PUBLIC (node->symbol.decl) || TREE_PUBLIC (node->symbol.decl)
|| DECL_EXTERNAL (node->symbol.decl)); || DECL_EXTERNAL (node->symbol.decl));
if (cgraph_externally_visible_p (node, whole_program, if (cgraph_externally_visible_p (node, whole_program))
pointer_set_contains (aliased_nodes,
node)))
{ {
gcc_assert (!node->global.inlined_to); gcc_assert (!node->global.inlined_to);
node->symbol.externally_visible = true; node->symbol.externally_visible = true;
...@@ -898,9 +853,7 @@ function_and_variable_visibility (bool whole_program) ...@@ -898,9 +853,7 @@ function_and_variable_visibility (bool whole_program)
{ {
if (!vnode->finalized) if (!vnode->finalized)
continue; continue;
if (varpool_externally_visible_p if (varpool_externally_visible_p (vnode))
(vnode,
pointer_set_contains (aliased_vnodes, vnode)))
vnode->symbol.externally_visible = true; vnode->symbol.externally_visible = true;
else else
vnode->symbol.externally_visible = false; vnode->symbol.externally_visible = false;
...@@ -913,8 +866,6 @@ function_and_variable_visibility (bool whole_program) ...@@ -913,8 +866,6 @@ function_and_variable_visibility (bool whole_program)
vnode->symbol.resolution = LDPR_PREVAILING_DEF_IRONLY; vnode->symbol.resolution = LDPR_PREVAILING_DEF_IRONLY;
} }
} }
pointer_set_destroy (aliased_nodes);
pointer_set_destroy (aliased_vnodes);
if (dump_file) if (dump_file)
{ {
......
...@@ -191,7 +191,7 @@ varpool_add_new_variable (tree decl) ...@@ -191,7 +191,7 @@ varpool_add_new_variable (tree decl)
struct varpool_node *node; struct varpool_node *node;
varpool_finalize_decl (decl); varpool_finalize_decl (decl);
node = varpool_node_for_decl (decl); node = varpool_node_for_decl (decl);
if (varpool_externally_visible_p (node, false)) if (varpool_externally_visible_p (node))
node->symbol.externally_visible = true; node->symbol.externally_visible = true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment