Commit e5b962d0 by Jan Hubicka Committed by Jan Hubicka

ipa.c (cgraph_externally_visible_p, [...]): Local comdats are not externally visible.


	* ipa.c (cgraph_externally_visible_p, varpool_externally_visible_p):
	Local comdats are not externally visible.
	* symtab.c (dump_symtab_base): Dump externally visible.
	(verify_symtab_base): Verify back links in the symtab hash.

From-SVN: r200064
parent a8355e51
2013-06-13 Jan Hubicka <jh@suse.cz>
* ipa.c (cgraph_externally_visible_p, varpool_externally_visible_p):
Local comdats are not externally visible.
* symtab.c (dump_symtab_base): Dump externally visible.
(verify_symtab_base): Verify back links in the symtab hash.
2013-06-13 Bin Cheng <bin.cheng@arm.com> 2013-06-13 Bin Cheng <bin.cheng@arm.com>
* fold-const.c (operand_equal_p): Consider NOP_EXPR and * fold-const.c (operand_equal_p): Consider NOP_EXPR and
......
...@@ -606,9 +606,8 @@ cgraph_externally_visible_p (struct cgraph_node *node, ...@@ -606,9 +606,8 @@ cgraph_externally_visible_p (struct cgraph_node *node,
{ {
if (!node->symbol.definition) if (!node->symbol.definition)
return false; return false;
if (!DECL_COMDAT (node->symbol.decl) if (!TREE_PUBLIC (node->symbol.decl)
&& (!TREE_PUBLIC (node->symbol.decl) || DECL_EXTERNAL (node->symbol.decl))
|| DECL_EXTERNAL (node->symbol.decl)))
return false; return false;
/* 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
...@@ -667,7 +666,7 @@ varpool_externally_visible_p (struct varpool_node *vnode) ...@@ -667,7 +666,7 @@ varpool_externally_visible_p (struct varpool_node *vnode)
if (DECL_EXTERNAL (vnode->symbol.decl)) if (DECL_EXTERNAL (vnode->symbol.decl))
return true; return true;
if (!DECL_COMDAT (vnode->symbol.decl) && !TREE_PUBLIC (vnode->symbol.decl)) if (!TREE_PUBLIC (vnode->symbol.decl))
return false; return false;
/* If linker counts on us, we must preserve the function. */ /* If linker counts on us, we must preserve the function. */
......
...@@ -508,6 +508,8 @@ dump_symtab_base (FILE *f, symtab_node node) ...@@ -508,6 +508,8 @@ dump_symtab_base (FILE *f, symtab_node node)
fprintf (f, " force_output"); fprintf (f, " force_output");
if (node->symbol.forced_by_abi) if (node->symbol.forced_by_abi)
fprintf (f, " forced_by_abi"); fprintf (f, " forced_by_abi");
if (node->symbol.externally_visible)
fprintf (f, " externally_visible");
if (node->symbol.resolution != LDPR_UNKNOWN) if (node->symbol.resolution != LDPR_UNKNOWN)
fprintf (f, " %s", fprintf (f, " %s",
ld_plugin_symbol_resolution_names[(int)node->symbol.resolution]); ld_plugin_symbol_resolution_names[(int)node->symbol.resolution]);
...@@ -655,6 +657,15 @@ verify_symtab_base (symtab_node node) ...@@ -655,6 +657,15 @@ verify_symtab_base (symtab_node node)
error ("node not found in symtab decl hashtable"); error ("node not found in symtab decl hashtable");
error_found = true; error_found = true;
} }
if (hashed_node != node
&& (!is_a <cgraph_node> (node)
|| !dyn_cast <cgraph_node> (node)->clone_of
|| dyn_cast <cgraph_node> (node)->clone_of->symbol.decl
!= node->symbol.decl))
{
error ("node differs from symtab decl hashtable");
error_found = true;
}
} }
if (assembler_name_hash) if (assembler_name_hash)
{ {
......
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