aboutsummaryrefslogtreecommitdiff
path: root/gcc/varpool.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-12-08 23:02:23 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2015-12-08 22:02:23 +0000
commit9b21e866825085e069dd2763a702202cb9adeb16 (patch)
tree45e5fa8debe25103566c68d50a4572bfba529fdc /gcc/varpool.c
parentced7e9584b848a8d5975b23efb5eac04ee2aee6f (diff)
downloadgcc-9b21e866825085e069dd2763a702202cb9adeb16.zip
gcc-9b21e866825085e069dd2763a702202cb9adeb16.tar.gz
gcc-9b21e866825085e069dd2763a702202cb9adeb16.tar.bz2
re PR lto/61886 (LTO breaks fread with _FORTIFY_SOURCE=2)
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. From-SVN: r231429
Diffstat (limited to 'gcc/varpool.c')
-rw-r--r--gcc/varpool.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/varpool.c b/gcc/varpool.c
index ffbec6d..ac77269 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);
}
}
}