This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/84923] [8/9 regression] gcc.dg/attr-weakref-1.c failed on aarch64
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 25 Apr 2018 11:02:07 +0000
- Subject: [Bug target/84923] [8/9 regression] gcc.dg/attr-weakref-1.c failed on aarch64
- Auto-submitted: auto-generated
- References: <bug-84923-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84923
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
So in spirit of the comment#2 patch I'd propose
Index: gcc/varasm.c
===================================================================
--- gcc/varasm.c (revision 259638)
+++ gcc/varasm.c (working copy)
@@ -5641,7 +5641,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;
given do_assemble_alias skips the weak_finish part if TREE_SYMBOL_REFERENCED
(target) and thus will not end up removing target from the alias list.
The above makes both paths match.