From: hubicka Date: Tue, 8 Dec 2015 22:01:41 +0000 (+0000) Subject: PR ipa/61886 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0325f3fd1210be78e964073943fe5e00696f0c03;p=thirdparty%2Fgcc.git PR ipa/61886 * ipa-visibility.c (can_replace_by_local_alias): Look through transparent aliaes; refuse weakrefs. (update_visibility_by_resolution_info): Skip transparent aliases in the analysis part git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231428 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e4c720774dde..8554091625c0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2015-12-08 Jan Hubicka + + PR ipa/61886 + * ipa-visibility.c (can_replace_by_local_alias): Look through transparent + aliaes; refuse weakrefs. + (update_visibility_by_resolution_info): Skip transparent aliases in the + analysis part + 2015-12-08 Jan Hubicka PR ipa/61886 diff --git a/gcc/ipa-visibility.c b/gcc/ipa-visibility.c index 0423f242af06..5b03159197ce 100644 --- a/gcc/ipa-visibility.c +++ b/gcc/ipa-visibility.c @@ -332,6 +332,13 @@ varpool_node::externally_visible_p (void) bool can_replace_by_local_alias (symtab_node *node) { + /* Weakrefs have a reason to be non-local. Be sure we do not replace + them. */ + while (node->transparent_alias && node->definition && !node->weakref) + node = node->get_alias_target (); + if (node->weakref) + return false; + return (node->get_availability () > AVAIL_INTERPOSABLE && !decl_binds_to_current_def_p (node->decl) && !node->can_be_discarded_p ()); @@ -392,7 +399,7 @@ update_visibility_by_resolution_info (symtab_node * node) for (symtab_node *next = node->same_comdat_group; next != node; next = next->same_comdat_group) { - if (!next->externally_visible) + if (!next->externally_visible || next->transparent_alias) continue; bool same_def