re PR target/84923 (gcc.dg/attr-weakref-1.c failed on aarch64)
authorVladimir Mezentsev <vladimir.mezentsev@oracle.com>
Mon, 21 May 2018 20:30:00 +0000 (20:30 +0000)
committerJeff Law <law@gcc.gnu.org>
Mon, 21 May 2018 20:30:00 +0000 (14:30 -0600)
        PR gcc/84923
        * varasm.c (weak_finish): Clean up weak_decls.

From-SVN: r260485

gcc/ChangeLog
gcc/varasm.c

index b247c1fd28dbd909b6388bccd640bf06e02516a4..655512627439d83d94ee52cc80541d2383137628 100644 (file)
@@ -1,3 +1,8 @@
+2018-05-21  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
+
+       PR gcc/84923
+       * varasm.c (weak_finish): Clean up weak_decls.
+
 2018-05-21  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        * config/aarch64/aarch64.md ("unspec"): Define UNSPEC_SABAL,
index 85296b4a2ec44b3b59226cb484ba875986d7efa1..8cf6e1e27582e2bce7500a05a77f240994e6999a 100644 (file)
@@ -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;