From patchwork Fri May 11 06:30:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Mezentsev X-Patchwork-Id: 911791 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-477563-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="XuooXpzL"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40j0c11X6vz9s15 for ; Fri, 11 May 2018 16:31:27 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; q=dns; s=default; b=NBOLSVpm/HJW wYD7/jyiBu8RKmyzZWmk1xw0u9Eu2kETurLw/NlSmjLsog1CFSFx1XHzO2GRnXdR PFMflrd+TtsWHNk9TQB79zvwWFwrxokL4Tnz+kLU8lLc3andvnQerC4m3g/KSPlu p4M/uKjSVDvMo6jP5g2BlBbn001Q0uU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; s=default; bh=QTaMprXpf2FtWLmCdW ur+3P9iTw=; b=XuooXpzLW85iuR8PASRp+InYxPEohpcZ7aOO3UJc0He4cCWdMq a2IcG6HAZbMNRzT15PtyzY8/U9rqD8h6T7z2p31XUtI5MwfMM+HuEEWaFcpUOCAl ujJRXOmFiaKsQGHt8HyTGMKlhJgKSTIeAkNVqa4CVDV/umU8DUoRnEnyY= Received: (qmail 20840 invoked by alias); 11 May 2018 06:31:06 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 20561 invoked by uid 89); 11 May 2018 06:30:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, KAM_STOCKGEN, RCVD_IN_DNSWL_LOW, SPF_HELO_PASS, SPF_PASS, UNPARSEABLE_RELAY autolearn=ham version=3.3.2 spammy=Vladimir, mezentsev, vladimir, 84923 X-HELO: aserp2120.oracle.com Received: from aserp2120.oracle.com (HELO aserp2120.oracle.com) (141.146.126.78) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 11 May 2018 06:30:41 +0000 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4B6QTEc014435 for ; Fri, 11 May 2018 06:30:39 GMT Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2hvth9aqsr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 11 May 2018 06:30:39 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w4B6UcVB018756 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 11 May 2018 06:30:38 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w4B6UcRt031971 for ; Fri, 11 May 2018 06:30:38 GMT Received: from localhost.us.oracle.com (/10.211.14.192) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 10 May 2018 23:30:37 -0700 From: vladimir.mezentsev@oracle.com To: gcc-patches@gcc.gnu.org Cc: vladimir.mezentsev@oracle.com Subject: [PATCH] PR gcc/84923 - gcc.dg/attr-weakref-1.c failed on aarch64 Date: Fri, 11 May 2018 06:30:26 +0000 Message-Id: <1526020226-13904-1-git-send-email-vladimir.mezentsev@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8889 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805110059 From: Vladimir Mezentsev When weakref_targets is not empty a target cannot be removed from the weak list. A small example is below when 'wv12' is removed from the weak list on aarch64: static vtype Wv12 __attribute__((weakref ("wv12"))); extern vtype wv12 __attribute__((weak)); Bootstrapped on aarch64-unknown-linux-gnu including (c,c++ and go). Tested on aarch64-linux-gnu. No regression. The attr-weakref-1.c test passed. ChangeLog: 2018-05-10 Vladimir Mezentsev PR gcc/84923 * varasm.c (weak_finish): clean up weak_decls --- gcc/varasm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/varasm.c b/gcc/varasm.c index 85296b4..8cf6e1e 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;