Commit 0e27699a by Jan Hubicka

lto-symtab.c (lto_varpool_replace_node): Remove code handling extra name aliases.


	* lto-symtab.c (lto_varpool_replace_node): Remove code handling
	extra name aliases.
	(lto_symtab_resolve_can_prevail_p): Likewise.
	(lto_symtab_merge_cgraph_nodes): Update alias_of pointers.
	* cgraphbuild.c (record_reference): Remove extra body alias code.
	(mark_load): Likewise.
	(mark_store): Likewise.
	* cgraph.h (varpool_node): Remove extra_name filed;
	add alias_of and extraname_alias.
	(varpool_create_variable_alias, varpool_for_node_and_aliases): Declare.
	(varpool_alias_aliased_node): New inline function.
	(varpool_variable_node): New function.
	* cgraphunit.c (handle_alias_pairs): Handle also variable aliases.
	* ipa-ref.c (ipa_record_reference): Allow aliases on variables.
	* lto-cgraph.c (lto_output_varpool_node): Update streaming.
	(input_varpool_node): Likewise.
	* lto-streamer-out.c (produce_symtab): Remove extra name aliases.
	(varpool_externally_visible_p): Remove extra body alias code.
	(function_and_variable_visibility): Likewise.
	* tree-ssa-structalias.c (associate_varinfo_to_alias_1): New function.
	(ipa_pta_execute): Use it.
	* varpool.c (varpool_remove_node): Remove extra name alias code.
	(varpool_mark_needed_node): Likewise.
	(varpool_analyze_pending_decls): Analyze aliases.
	(assemble_aliases): New functoin.
	(varpool_assemble_decl): Use it.
	(varpool_create_variable_alias): New function.
	(varpool_extra_name_alias): Rewrite.
	(varpool_for_node_and_aliases): New function.

From-SVN: r175169
parent 3bd72190
...@@ -655,7 +655,6 @@ cgraph_externally_visible_p (struct cgraph_node *node, ...@@ -655,7 +655,6 @@ cgraph_externally_visible_p (struct cgraph_node *node,
static bool static bool
varpool_externally_visible_p (struct varpool_node *vnode, bool aliased) varpool_externally_visible_p (struct varpool_node *vnode, bool aliased)
{ {
struct varpool_node *alias;
if (!DECL_COMDAT (vnode->decl) && !TREE_PUBLIC (vnode->decl)) if (!DECL_COMDAT (vnode->decl) && !TREE_PUBLIC (vnode->decl))
return false; return false;
...@@ -668,14 +667,6 @@ varpool_externally_visible_p (struct varpool_node *vnode, bool aliased) ...@@ -668,14 +667,6 @@ varpool_externally_visible_p (struct varpool_node *vnode, bool aliased)
if (varpool_used_from_object_file_p (vnode)) if (varpool_used_from_object_file_p (vnode))
return true; return true;
/* FIXME: We get wrong symbols with asm aliases in callgraph and LTO.
This is because very little of code knows that assembler name needs to
mangled. Avoid touching declarations with user asm name set to mask
some of the problems. */
if (DECL_ASSEMBLER_NAME_SET_P (vnode->decl)
&& IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (vnode->decl))[0]=='*')
return true;
if (DECL_PRESERVE_P (vnode->decl)) if (DECL_PRESERVE_P (vnode->decl))
return true; return true;
if (lookup_attribute ("externally_visible", if (lookup_attribute ("externally_visible",
...@@ -694,11 +685,6 @@ varpool_externally_visible_p (struct varpool_node *vnode, bool aliased) ...@@ -694,11 +685,6 @@ varpool_externally_visible_p (struct varpool_node *vnode, bool aliased)
This is needed for i.e. references from asm statements. */ This is needed for i.e. references from asm statements. */
if (varpool_used_from_object_file_p (vnode)) if (varpool_used_from_object_file_p (vnode))
return true; return true;
for (alias = vnode->extra_name; alias; alias = alias->next)
if (alias->resolution != LDPR_PREVAILING_DEF_IRONLY)
break;
if (!alias && vnode->resolution == LDPR_PREVAILING_DEF_IRONLY)
return false;
/* As a special case, the COMDAT virutal tables can be unshared. /* As a special case, the COMDAT virutal tables can be unshared.
In LTO mode turn vtables into static variables. The variable is readonly, In LTO mode turn vtables into static variables. The variable is readonly,
...@@ -782,13 +768,7 @@ function_and_variable_visibility (bool whole_program) ...@@ -782,13 +768,7 @@ function_and_variable_visibility (bool whole_program)
{ {
if (!node->analyzed) if (!node->analyzed)
continue; continue;
/* Weakrefs alias symbols from other compilation unit. In the case cgraph_mark_needed_node (node);
the destination of weakref became available because of LTO, we must
mark it as needed. */
if (in_lto_p
&& lookup_attribute ("weakref", DECL_ATTRIBUTES (p->decl))
&& !node->needed)
cgraph_mark_needed_node (node);
gcc_assert (node->needed); gcc_assert (node->needed);
pointer_set_insert (aliased_nodes, node); pointer_set_insert (aliased_nodes, node);
if (dump_file) if (dump_file)
...@@ -798,13 +778,7 @@ function_and_variable_visibility (bool whole_program) ...@@ -798,13 +778,7 @@ function_and_variable_visibility (bool whole_program)
else if ((vnode = varpool_node_for_asm (p->target)) != NULL else if ((vnode = varpool_node_for_asm (p->target)) != NULL
&& !DECL_EXTERNAL (vnode->decl)) && !DECL_EXTERNAL (vnode->decl))
{ {
/* Weakrefs alias symbols from other compilation unit. In the case varpool_mark_needed_node (vnode);
the destination of weakref became available because of LTO, we must
mark it as needed. */
if (in_lto_p
&& lookup_attribute ("weakref", DECL_ATTRIBUTES (p->decl))
&& !vnode->needed)
varpool_mark_needed_node (vnode);
gcc_assert (vnode->needed); gcc_assert (vnode->needed);
pointer_set_insert (aliased_vnodes, vnode); pointer_set_insert (aliased_vnodes, vnode);
if (dump_file) if (dump_file)
......
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