From patchwork Wed Oct 25 09:02:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 157945 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2461270vqx; Wed, 25 Oct 2023 02:02:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGVPtTc9ujLapv8cQ5BVNjj1SHdFEYrTTnoKnxVxBLZbfmfMz5hd29Czsifnd/fX+D2SvYg X-Received: by 2002:a05:6214:19ef:b0:66d:55d9:9522 with SMTP id q15-20020a05621419ef00b0066d55d99522mr21160424qvc.23.1698224560771; Wed, 25 Oct 2023 02:02:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698224560; cv=pass; d=google.com; s=arc-20160816; b=k8TFEXbnbqjSDsLgxj5Z/ADLwOr5Owf59Vhp5CmlK/T/6diHER6ERZ3oUOLd4Lgtkw vSem8Z4ZMf8MzNV2W25938ulFGxnLjIJP0HJxe4ZYbgCWM15M5BO4sOKzUMi9dnGgQOE +XcPTDzHV4p29uI4fvrpet/GyTDJd50CVYqCH3mIgh9aHSEl0w/+8np15hFIkyC3nG0v j8HPB4oDxU4rnU61w/7A92o5zArFaHNX+I4eJxDbUvL/5d3WULTI3209XP/XkSPzjUf/ 3uiFMYHZl/dT5lScxFWYzv30BLv9H/xfXIysIwrS5Q3WV/18dlYDt7IHEBPJubA/AyWW +UgA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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 :arc-filter:dmarc-filter:delivered-to; bh=ihxAmzds2ITKPIAHC3onl706xjywHMO/HdjRMIPBH1g=; fh=sWwT+rOYkCxnQbVM6TXAcwWGCueSuKsqr0SFTw5NLgg=; b=DgKz/nZ7iDrmmTd330JhbTd4ArNMvXT++zGEeNm3VrGz2pmv7f9YDQj6GGl3iPGcdR 4VzTwFuhIbtmm7QQyNXUNx3fOW3DHYRZZDVGq1ZZFRlO+FUWxTWnrlKIPkPxN5/KunZP XkyPCCQT26oxpIw1QqmaG0Yv8iGkzATQUSGc8iU5U25GNsBZ0B8Z3aSTvDWZ1YPfFSUO +s6ibs+wfNlwIOyuhMaiO+ReE4MxMB3wJdSwSv6+RTLsZdRCxaaQQxGw2apW3yuhFZtS 5fDIQ5+108gLYhihzEEGG+9vv5zJlJTdjMvmMOrZj1RCjeEHNIKoWAmr9AMT3EXyUSP3 P/Pg== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); 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 (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id cu17-20020a05621417d100b0066d19d6a761si8244591qvb.279.2023.10.25.02.02.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 02:02:40 -0700 (PDT) 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; arc=pass (i=1); 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 727AA385700C for ; Wed, 25 Oct 2023 09:02:40 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id 786543858C53 for ; Wed, 25 Oct 2023 09:02:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 786543858C53 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 786543858C53 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.137.252 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698224537; cv=none; b=LB2Lkjr/bMPAKAM4LFe1gx8TnvVflnkAMZJHSaGUyV/1aETh6w/9aE89q6TxukV9VdzhoY+CcFKo/DBNdfUzPvcKp3whT5gxTBB6+psSF0Ur3ZwOEMotHDOg8s4cNbJNqVheXSp79Lp46VqIMnPNRu2SwASKZN4bro3jECHoCBk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698224537; c=relaxed/simple; bh=tKShv4A/dcP18w8ZnffsGnsaOQw/mkFMtfLKCslIZ+w=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=lWk+h0jyd+K2nXxdKUQtWSCq9/4P0mUh+amzCyf4xJh3UXTrHT0YpDLZHH3YANKCBa6UMujpC6lrTvQoGYg91Bu/zgzss8bbzSmr8k3q4UGtkM+TGL8931Gh2nctidUfetrH0tkrgWb5nzAzjb1J7vmClYboVP555f6C1EhWKIs= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: Zwori8l9QO+ncmZlJv6vYg== X-CSE-MsgGUID: 72zpu4jJT6yxCmWqbed/ww== X-IronPort-AV: E=Sophos;i="6.03,250,1694764800"; d="scan'208,223";a="20690043" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 25 Oct 2023 01:02:11 -0800 IronPort-SDR: oNitWkUKo4LjBcrhayR9JDfe5pTHDnef4da7cPoP/UZ7a1Mpn9ESeNB+FL/VaVxINbiQ1AXZvt /h8jSeAhAbhSBIrhCEVWFQm+PXjQSJzUt6YDXHhyBHpHEimIK27TW6Hipfzxcnz12LvRv2Srfk rsYevjCQAFGkrqEvuAPi42dG0nO5za0fpFybAo+m7K6etOMw9ANJxTdqJQXScKJviO2MEov+N3 U64jGterPSbdsKeHRU57TZuqBRyS4nd9ZHzUsjSRpKT8hoS/3F949uTC7ZZ6cQ0FevCUOlLZ42 6Qo= From: Thomas Schwinge To: Chung-Lin Tang , CC: Catherine Moore , Tobias Burnus Subject: Enable 'c-c++-common/goacc/{if,self}-clause-1.c' for C++ (was: [PATCH, OpenACC 2.7] Implement self clause for compute constructs) In-Reply-To: <87pm13w04d.fsf@euler.schwinge.homeip.net> References: <87pm13w04d.fsf@euler.schwinge.homeip.net> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Wed, 25 Oct 2023 11:02:04 +0200 Message-ID: <87msw7vzw3.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, 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.30 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780717516952412969 X-GMAIL-MSGID: 1780717516952412969 Hi! On 2023-10-25T10:57:06+0200, I wrote: > With minor textual conflicts resolved, I've pushed this to master branch > in commit 3a3596389c2e539cb8fd5dc5784a4e2afe193a2a > "OpenACC 2.7: Implement self clause for compute constructs", see > attached. > > > I'll then apply/submit a number of follow-on commits. > --- /dev/null > +++ b/gcc/testsuite/c-c++-common/goacc/self-clause-1.c > @@ -0,0 +1,22 @@ > +/* { dg-skip-if "not yet" { c++ } } */ Pushed to master branch commit 76cc5463227308c4dd2b70ccfe04d2b5361db0fe "Enable 'c-c++-common/goacc/{if,self}-clause-1.c' for C++", see attached. > + > +void > +f (int b) > +{ > + struct { int i; } *p; > + > +#pragma acc parallel self self(b) /* { dg-error "too many 'self' clauses" } */ > + ; > +#pragma acc parallel self(*p) /* { dg-error "used struct type value where scalar is required" } */ > + ; > + > +#pragma acc kernels self self(b) /* { dg-error "too many 'self' clauses" } */ > + ; > +#pragma acc kernels self(*p) /* { dg-error "used struct type value where scalar is required" } */ > + ; > + > +#pragma acc serial self self(b) /* { dg-error "too many 'self' clauses" } */ > + ; > +#pragma acc serial self(*p) /* { dg-error "used struct type value where scalar is required" } */ > + ; > +} 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 76cc5463227308c4dd2b70ccfe04d2b5361db0fe Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 20 Oct 2023 14:07:37 +0200 Subject: [PATCH] Enable 'c-c++-common/goacc/{if,self}-clause-1.c' for C++ As discovered via recent commit 3a3596389c2e539cb8fd5dc5784a4e2afe193a2a "OpenACC 2.7: Implement self clause for compute constructs", 'c-c++-common/goacc/if-clause-1.c', which the new 'c-c++-common/goacc/self-clause-1.c' was copied from, was not enabled for C++. gcc/testsuite/ * c-c++-common/goacc/if-clause-1.c: Enable for C++ * c-c++-common/goacc/self-clause-1.c: Likewise. --- gcc/testsuite/c-c++-common/goacc/if-clause-1.c | 6 ++++-- gcc/testsuite/c-c++-common/goacc/self-clause-1.c | 14 ++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/gcc/testsuite/c-c++-common/goacc/if-clause-1.c b/gcc/testsuite/c-c++-common/goacc/if-clause-1.c index 85abf1659e9..d78520bdd1b 100644 --- a/gcc/testsuite/c-c++-common/goacc/if-clause-1.c +++ b/gcc/testsuite/c-c++-common/goacc/if-clause-1.c @@ -1,4 +1,4 @@ -/* { dg-skip-if "not yet" { c++ } } */ +/* See also 'self-clause-1.c'. */ void f (void) @@ -6,5 +6,7 @@ f (void) struct { int i; } *p; #pragma acc data copyout(p) if(1) if(1) /* { dg-error "too many 'if' clauses" } */ ; -#pragma acc update device(p) if(*p) /* { dg-error "used struct type value where scalar is required" } */ +#pragma acc update device(p) if(*p) + /* { dg-error {used struct type value where scalar is required} {} { target c } .-1 } + { dg-error {could not convert '\* p' from 'f\(\)::' to 'bool'} {} { target c++ } .-2 } */ } diff --git a/gcc/testsuite/c-c++-common/goacc/self-clause-1.c b/gcc/testsuite/c-c++-common/goacc/self-clause-1.c index ed5d072e81f..fe892bea210 100644 --- a/gcc/testsuite/c-c++-common/goacc/self-clause-1.c +++ b/gcc/testsuite/c-c++-common/goacc/self-clause-1.c @@ -1,4 +1,4 @@ -/* { dg-skip-if "not yet" { c++ } } */ +/* See also 'if-clause-1.c'. */ void f (int b) @@ -7,16 +7,22 @@ f (int b) #pragma acc parallel self self(b) /* { dg-error "too many 'self' clauses" } */ ; -#pragma acc parallel self(*p) /* { dg-error "used struct type value where scalar is required" } */ +#pragma acc parallel self(*p) + /* { dg-error {used struct type value where scalar is required} {} { target c } .-1 } + { dg-error {could not convert '\* p' from 'f\(int\)::' to 'bool'} {} { target c++ } .-2 } */ ; #pragma acc kernels self self(b) /* { dg-error "too many 'self' clauses" } */ ; -#pragma acc kernels self(*p) /* { dg-error "used struct type value where scalar is required" } */ +#pragma acc kernels self(*p) + /* { dg-error {used struct type value where scalar is required} {} { target c } .-1 } + { dg-error {could not convert '\* p' from 'f\(int\)::' to 'bool'} {} { target c++ } .-2 } */ ; #pragma acc serial self self(b) /* { dg-error "too many 'self' clauses" } */ ; -#pragma acc serial self(*p) /* { dg-error "used struct type value where scalar is required" } */ +#pragma acc serial self(*p) + /* { dg-error {used struct type value where scalar is required} {} { target c } .-1 } + { dg-error {could not convert '\* p' from 'f\(int\)::' to 'bool'} {} { target c++ } .-2 } */ ; } -- 2.34.1