From a3c7081913149383df639270f4972d3d5876b7b3 Mon Sep 17 00:00:00 2001 From: Vladimir Mezentsev Date: Mon, 21 May 2018 20:30:00 +0000 Subject: [PATCH] re PR target/84923 (gcc.dg/attr-weakref-1.c failed on aarch64) PR gcc/84923 * varasm.c (weak_finish): Clean up weak_decls. From-SVN: r260485 --- gcc/ChangeLog | 5 +++++ gcc/varasm.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b247c1fd28d..65551262743 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-05-21 Vladimir Mezentsev + + PR gcc/84923 + * varasm.c (weak_finish): Clean up weak_decls. + 2018-05-21 Kyrylo Tkachov * config/aarch64/aarch64.md ("unspec"): Define UNSPEC_SABAL, diff --git a/gcc/varasm.c b/gcc/varasm.c index 85296b4a2ec..8cf6e1e2758 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -5652,7 +5652,8 @@ weak_finish (void) tree alias_decl = TREE_PURPOSE (t); tree target = ultimate_transparent_alias_target (&TREE_VALUE (t)); - if (! TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (alias_decl))) + if (! TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (alias_decl)) + || TREE_SYMBOL_REFERENCED (target)) /* Remove alias_decl from the weak list, but leave entries for the target alone. */ target = NULL_TREE; -- 2.30.2