From dfbba356294442232ac18bccfaab55b8b8bed053 Mon Sep 17 00:00:00 2001 From: hubicka Date: Tue, 8 Dec 2015 22:02:23 +0000 Subject: [PATCH] PR ipa/61886 * varpool.c (varpool_node::get_availability): Recurse only on weakrefs with definition in the target. (symbol_table::remove_unreferenced_decls): Keep aliases in the boundary. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231429 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 11 +++++++++-- gcc/varpool.c | 10 +++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8554091625c0..55f89c9fd588 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,8 +1,15 @@ 2015-12-08 Jan Hubicka PR ipa/61886 - * ipa-visibility.c (can_replace_by_local_alias): Look through transparent - aliaes; refuse weakrefs. + * varpool.c (varpool_node::get_availability): Recurse only on + weakrefs with definition in the target. + (symbol_table::remove_unreferenced_decls): Keep aliases in the boundary. + +2015-12-08 Jan Hubicka + + PR ipa/61886 + * ipa-visibility.c (can_replace_by_local_alias): Look through + transparent aliases; refuse weakrefs. (update_visibility_by_resolution_info): Skip transparent aliases in the analysis part diff --git a/gcc/varpool.c b/gcc/varpool.c index ffbec6d727a4..ac77269a7385 100644 --- a/gcc/varpool.c +++ b/gcc/varpool.c @@ -490,7 +490,7 @@ varpool_node::get_availability (void) if (DECL_IN_CONSTANT_POOL (decl) || DECL_VIRTUAL_P (decl)) return AVAIL_AVAILABLE; - if (transparent_alias) + if (transparent_alias && definition) { enum availability avail; @@ -667,11 +667,11 @@ symbol_table::remove_unreferenced_decls (void) enqueue_node (vnode, &first); else { - referenced.add (node); - while (node->alias && node->definition) + referenced.add (vnode); + while (vnode && vnode->alias && vnode->definition) { - node = node->get_alias_target (); - referenced.add (node); + vnode = vnode->get_alias_target (); + referenced.add (vnode); } } } -- 2.47.2