aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2013-06-05 00:58:22 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2013-06-04 22:58:22 +0000
commitb9bd2075e20c6db31320ef73fa1721483f5d54f6 (patch)
treed5c2cb6bca860b0c073d207e96501af0f8244efc
parentaaae719df3df968a3a5cf5a03a8fb9d1889f1a50 (diff)
downloadgcc-b9bd2075e20c6db31320ef73fa1721483f5d54f6.zip
gcc-b9bd2075e20c6db31320ef73fa1721483f5d54f6.tar.gz
gcc-b9bd2075e20c6db31320ef73fa1721483f5d54f6.tar.bz2
lto-cgraph.c (get_alias_symbol): Remove weakref sanity check.
* lto-cgraph.c (get_alias_symbol): Remove weakref sanity check. (input_node, input_varpool_node): Handle correctly external same body aliases. * ipa.c (symtab_remove_unreachable_nodes): Do not remove external nodes at ltrans stage. From-SVN: r199675
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/ipa.c6
-rw-r--r--gcc/lto-cgraph.c7
3 files changed, 17 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 690c968..c168af8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
2013-06-04 Jan Hubicka <jh@suse.cz>
+ * lto-cgraph.c (get_alias_symbol): Remove weakref sanity check.
+ (input_node, input_varpool_node): Handle correctly external same
+ body aliases.
+ * ipa.c (symtab_remove_unreachable_nodes): Do not remove external
+ nodes at ltrans stage.
+
+2013-06-04 Jan Hubicka <jh@suse.cz>
+
* ipa-inline.c (update_caller_keys): Fix availability test.
(update_callee_keys): Likewise.
* symtab.c (symtab_alias_ultimate_target): Make availaiblity logic
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 5382b7a..443d737 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -387,7 +387,11 @@ symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
for (vnode = varpool_first_variable (); vnode; vnode = vnext)
{
vnext = varpool_next_variable (vnode);
- if (!vnode->symbol.aux)
+ if (!vnode->symbol.aux
+ /* For can_refer_decl_in_current_unit_p we want to track for
+ all external variables if they are defined in other partition
+ or not. */
+ && (!flag_ltrans || !DECL_EXTERNAL (vnode->symbol.decl)))
{
if (file)
fprintf (file, " %s", varpool_node_name (vnode));
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index 6699b8a..065d848 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -918,7 +918,6 @@ static tree
get_alias_symbol (tree decl)
{
tree alias = lookup_attribute ("alias", DECL_ATTRIBUTES (decl));
- gcc_assert (lookup_attribute ("weakref", DECL_ATTRIBUTES (decl)));
return get_identifier (TREE_STRING_POINTER
(TREE_VALUE (TREE_VALUE (alias))));
}
@@ -1008,7 +1007,8 @@ input_node (struct lto_file_decl_data *file_data,
node->thunk.virtual_value = virtual_value;
node->thunk.virtual_offset_p = (type & 4);
}
- if (node->symbol.alias && !node->symbol.analyzed)
+ if (node->symbol.alias && !node->symbol.analyzed
+ && lookup_attribute ("weakref", DECL_ATTRIBUTES (node->symbol.decl)))
node->symbol.alias_target = get_alias_symbol (node->symbol.decl);
return node;
}
@@ -1050,7 +1050,8 @@ input_varpool_node (struct lto_file_decl_data *file_data,
DECL_EXTERNAL (node->symbol.decl) = 1;
TREE_STATIC (node->symbol.decl) = 0;
}
- if (node->symbol.alias && !node->symbol.analyzed)
+ if (node->symbol.alias && !node->symbol.analyzed
+ && lookup_attribute ("weakref", DECL_ATTRIBUTES (node->symbol.decl)))
node->symbol.alias_target = get_alias_symbol (node->symbol.decl);
ref = streamer_read_hwi (ib);
/* Store a reference for now, and fix up later to be a pointer. */