lto-symtab.c (lto_symtab_merge_symbols): Add comments; merge duplicated nodes for assembler names.
* lto-symtab.c (lto_symtab_merge_symbols): Add comments; merge duplicated nodes for assembler names. * symtab.c (symtab_unregister_node): Do not attempt to unlink hard registers from assembler name hash. From-SVN: r202186
This commit is contained in:
parent
c91061e6b0
commit
8e4c9a109a
|
@ -1,3 +1,10 @@
|
|||
2013-09-02 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* lto-symtab.c (lto_symtab_merge_symbols): Add comments; merge
|
||||
duplicated nodes for assembler names.
|
||||
* symtab.c (symtab_unregister_node): Do not attempt to unlink
|
||||
hard registers from assembler name hash.
|
||||
|
||||
2013-09-02 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* ipa-split.c (execute_split_functions): Split externally visible
|
||||
|
|
|
@ -586,6 +586,9 @@ lto_symtab_merge_symbols (void)
|
|||
FOR_EACH_SYMBOL (node)
|
||||
{
|
||||
cgraph_node *cnode, *cnode2;
|
||||
varpool_node *vnode;
|
||||
symtab_node node2;
|
||||
|
||||
if (!node->symbol.analyzed && node->symbol.alias_target)
|
||||
{
|
||||
symtab_node tgt = symtab_node_for_asm (node->symbol.alias_target);
|
||||
|
@ -594,22 +597,37 @@ lto_symtab_merge_symbols (void)
|
|||
symtab_resolve_alias (node, tgt);
|
||||
}
|
||||
node->symbol.aux = NULL;
|
||||
|
||||
|
||||
if (!(cnode = dyn_cast <cgraph_node> (node))
|
||||
|| !cnode->clone_of
|
||||
|| cnode->clone_of->symbol.decl != cnode->symbol.decl)
|
||||
{
|
||||
/* Builtins are not merged via decl merging. It is however
|
||||
possible that tree merging unified the declaration. We
|
||||
do not want duplicate entries in symbol table. */
|
||||
if (cnode && DECL_BUILT_IN (node->symbol.decl)
|
||||
&& (cnode2 = cgraph_get_node (node->symbol.decl))
|
||||
&& cnode2 != cnode)
|
||||
lto_cgraph_replace_node (cnode2, cnode);
|
||||
|
||||
/* The user defined assembler variables are also not unified by their
|
||||
symbol name (since it is irrelevant), but we need to unify symbol
|
||||
nodes if tree merging occured. */
|
||||
if ((vnode = dyn_cast <varpool_node> (node))
|
||||
&& DECL_HARD_REGISTER (vnode->symbol.decl)
|
||||
&& (node2 = symtab_get_node (vnode->symbol.decl))
|
||||
&& node2 != node)
|
||||
lto_varpool_replace_node (dyn_cast <varpool_node> (node2),
|
||||
vnode);
|
||||
|
||||
|
||||
/* Abstract functions may have duplicated cgraph nodes attached;
|
||||
remove them. */
|
||||
else if (cnode && DECL_ABSTRACT (cnode->symbol.decl)
|
||||
&& (cnode2 = cgraph_get_node (node->symbol.decl))
|
||||
&& cnode2 != cnode)
|
||||
cgraph_remove_node (cnode2);
|
||||
|
||||
symtab_insert_node_to_hashtable ((symtab_node)node);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -283,7 +283,8 @@ symtab_unregister_node (symtab_node node)
|
|||
else
|
||||
*slot = replacement_node;
|
||||
}
|
||||
unlink_from_assembler_name_hash (node, false);
|
||||
if (!is_a <varpool_node> (node) || !DECL_HARD_REGISTER (node->symbol.decl))
|
||||
unlink_from_assembler_name_hash (node, false);
|
||||
}
|
||||
|
||||
/* Return symbol table node associated with DECL, if any,
|
||||
|
|
Loading…
Reference in New Issue