From patchwork Tue Feb 14 09:35:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 56806 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2865894wrn; Tue, 14 Feb 2023 01:36:22 -0800 (PST) X-Google-Smtp-Source: AK7set9Vy9JfzxNSsBcAG2DbJEZ7wTkzh6kM0MPrKZNUdo9OAy3QQT+WAKNoP3WDc/w/UK1Aja7w X-Received: by 2002:a17:907:7885:b0:888:9bd6:34d2 with SMTP id ku5-20020a170907788500b008889bd634d2mr2068073ejc.63.1676367382570; Tue, 14 Feb 2023 01:36:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676367382; cv=none; d=google.com; s=arc-20160816; b=u95Do+OyjOLSMXrQ1Wm1G3OIdshl/fSLyXLYOyF4DSdx3JFcJTNJjm+LqsZ/Lq6Jww my3H9sEt4dp2o36FMlrrM9n/uZrYZ5kVttZ0W+wxDiBtNUulSg9y5K+Mwgx2kxWjOMbV SSf1BWHaYL0BCYbRZh/hi6FB4V+dZCf4y6WPmQHiHJlgWg2QBMU68f3aEavzP82qIo1b FlxCDW/RniXwPSSIejBtJaI7XHtet7wRbjad1pTqrktAmz2BRK4NoX9+7Dk7h0c9u7DV O63/zDJhskUN3cT4UkgE9fJ/Txenl4LUY6jX1wHnvmFbYZHRe9dErQ/VEdHbPLtSHLmN +sNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:message-id:date :user-agent:references:in-reply-to:subject:cc:to:from:ironport-sdr :dmarc-filter:delivered-to; bh=uEsXpzx49kohUDPBZL1jF/vsHF7oK5y8VNK1NrEg3Xw=; b=MTPrEFgS3hmbd7w2t2/uT40dqkS9yXVb8/M+iujxUUPcT0JDMy/9WnPfBjoAKr19O+ B7gRmX+NzuzECYAtiKP9GG9QWnsMz7/7+OzvFokfnrHrwUOnFFcdM5+2SvAk+XA10bgJ z9kSUCipxtABBiEmwLBwkL02+7SqjkRqAQLfeyDMSA2QUKU2Ed0NDcRDpVcVPa9HNbRQ i8Gd4sGv6w6O9FdmysqR2VssDu0c3tgUNHxOr7VNKnx05aDjSA5oGw9TXlOoABoDmscU iK9WMvfB4mUBQtkrpMVPrMxvATHTAWNsU4IYUu08F//QrdkBjlxyrKVPbZYD9HDdPZLr HmSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id zz14-20020a170907350e00b00870b0d90078si15880880ejb.644.2023.02.14.01.36.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 01:36:22 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 59EB2385B527 for ; Tue, 14 Feb 2023 09:36:10 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 6EEF33858D1E; Tue, 14 Feb 2023 09:35:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6EEF33858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.97,296,1669104000"; d="scan'208,223";a="98023995" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 14 Feb 2023 01:35:37 -0800 IronPort-SDR: pOqAT1uhavSwgP07HlObLwj2L9djU+5FGsSwxV8IGLdxFfZegI5Bn3Kyx1l5+iVjkAz6xow1+B pqHWakW9OV0yO2U0Gv56rKE+7SNkYBufOqa4BG5uqPk4QGOm2waiAsV6pDkh7Cx39KQqc2y1pO j4jqMcH9xHTafLW2Ni3sP+Wm2UTwIJYnSZhNjTYuxpCoggsdBiCEh5o8SVaKKcvdRurppLWXkl YV9HzbzSXOMPNZyrQ3vCY0Qinx+JeBAUQu+QvF8fLr0LLHn6/VFJXchEKc6MACth3ewHx+UY/E mxo= From: Thomas Schwinge To: Harald Anlauf , Rimvydas Jasinskas , , CC: Tom de Vries Subject: nvptx: Adjust 'scan-assembler' in 'gfortran.dg/weak-1.f90' (was: Support for NOINLINE attribute) In-Reply-To: <0115618b-059b-fd11-a813-33374f16af78@gmx.de> References: <0115618b-059b-fd11-a813-33374f16af78@gmx.de> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Tue, 14 Feb 2023 10:35:29 +0100 Message-ID: <87h6vo8u8u.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757798604771177531?= X-GMAIL-MSGID: =?utf-8?q?1757798604771177531?= Hi! On 2023-02-13T18:50:23+0100, Harald Anlauf via Gcc-patches wrote: > Pushed as: > > commit 086a1df4374962787db37c1f0d1bd9beb828f9e3 > On 2/12/23 22:28, Harald Anlauf via Gcc-patches wrote: >> There is one thing I cannot test, which is the handling of weak symbols >> on other platforms. A quick glance at the C testcases suggests that >> someone with access to either an NVPTX or MingGW target might tell >> whether that particular target should be excluded. Indeed nvptx does use a different assembler syntax; I've pushed to master branch commit 8d8175869ca94c600e64e27b7676787b2a398f6e "nvptx: Adjust 'scan-assembler' in 'gfortran.dg/weak-1.f90'", see attached. And I'm curious, is '!GCC$ ATTRIBUTES weak' meant to be used only for weak definitions (like in 'gfortran.dg/weak-1.f90'), or also for weak declarations (which, for example, in the C world then evaluate to zero-address unless actually defined)? When I did a quick experiment, that didn't seem to work? (But may be my fault, of course.) And, orthogonally: is '!GCC$ ATTRIBUTES weak' meant to be used only for subroutines (like in 'gfortran.dg/weak-1.f90') and also functions (I suppose; test case?), or also for weak "data" in some way (which, for example, in the C world then evaluates to a zero-address unless actually defined)? Could help to at least add a few more test cases, and clarify the documentation? Grüße Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 From 8d8175869ca94c600e64e27b7676787b2a398f6e Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Tue, 14 Feb 2023 10:11:19 +0100 Subject: [PATCH] nvptx: Adjust 'scan-assembler' in 'gfortran.dg/weak-1.f90' Fix-up for recent commit 086a1df4374962787db37c1f0d1bd9beb828f9e3 "Fortran: Add !GCC$ attributes NOINLINE,NORETURN,WEAK". gcc/testsuite/ * gfortran.dg/weak-1.f90: Adjust 'scan-assembler' for nvptx. --- gcc/testsuite/gfortran.dg/weak-1.f90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/gfortran.dg/weak-1.f90 b/gcc/testsuite/gfortran.dg/weak-1.f90 index d9aca686775a..9ec1fe74053e 100644 --- a/gcc/testsuite/gfortran.dg/weak-1.f90 +++ b/gcc/testsuite/gfortran.dg/weak-1.f90 @@ -1,6 +1,7 @@ ! { dg-do compile } ! { dg-require-weak "" } -! { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?impl" } } +! { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?impl" { target { ! nvptx-*-* } } } } +! { dg-final { scan-assembler-times "\\.weak \\.func impl" 2 { target nvptx-*-* } } } subroutine impl !GCC$ ATTRIBUTES weak :: impl end subroutine -- 2.39.1