From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id D3FCC3857736; Wed, 3 May 2023 11:29:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D3FCC3857736 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.99,247,1677571200"; d="scan'208";a="4230858" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 03 May 2023 03:29:50 -0800 IronPort-SDR: TIFEAJ/Yf+oINtaALmHkhL2qU3mzW4iayJgEnwf8QrfBTEJErJBRJOma6A2Xmkf/iVbzX9iyXX rxQHFhed6Dx9r+RbzmtBn9q9b/Sek0oy9rkx2tO9DDxdwbepxdbilRLf5yr3S5V7hSTBsmthxo aTxbyNPgrADY7tNs/LE6vcGVYZSy7xlp2wo/AySLi8GDnrUhFpE/wGAvf7LbaJ4svgKngrkt0q yc6wyV4Ejpp+yOhkx8Iqm9tXgPuOAEuKh+6/hZS3iDBEQXBUXv0mPMzMXclRP42YixdAHEPknb cv8= From: Thomas Schwinge To: Julian Brown CC: , , , Subject: Re: [PATCH] OpenACC: Further attach/detach clause fixes for Fortran [PR109622] In-Reply-To: <20230429105741.108576-1-julian@codesourcery.com> References: <87bkj817yl.fsf@euler.schwinge.homeip.net> <20230429105741.108576-1-julian@codesourcery.com> User-Agent: Notmuch/0.29.1+93~g67ed7df (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Wed, 3 May 2023 13:29:41 +0200 Message-ID: <87a5ylwt3u.fsf@dem-tschwing-1.ger.mentorg.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=-5.8 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,KAM_SHORT,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Julian! On 2023-04-29T03:57:41-0700, Julian Brown wrote: > This patch moves several tests introduced by the following patch: > > https://gcc.gnu.org/pipermail/gcc-patches/2023-April/616939.html > > into the proper location for OpenACC testing (thanks to Thomas for > spotting my mistake!), and also fixes a few additional problems -- > missing diagnostics for non-pointer attaches, and a case where a pointer > was incorrectly dereferenced. Tests are also adjusted for vector-length > warnings on nvidia accelerators. > > Tested with offloading to nvptx. OK? Thanks for looking into this. I haven't reviewed the patch itself, but noticed one thing: > --- /dev/null > +++ b/gcc/testsuite/gfortran.dg/goacc/pr109622-5.f90 > @@ -0,0 +1,45 @@ > +! { dg-do compile } > + > +use openacc [...]/gfortran.dg/goacc/pr109622-5.f90:3:5: Fatal Error: Cannot open mo= dule file 'openacc.mod' for reading at (1): No such file or directory ... for GCC build-tree testing. Just remove the 'use openacc'; it's not necessary here. Gr=C3=BC=C3=9Fe Thomas > +implicit none > + > +type t > +integer :: foo > +character(len=3D8) :: bar > +integer :: qux(5) > +end type t > + > +type(t) :: var > + > +var%foo =3D 3 > +var%bar =3D "HELLOOMP" > +var%qux =3D (/ 1, 2, 3, 4, 5 /) > + > +!$acc enter data copyin(var) > + > +!$acc enter data attach(var%foo) > +! { dg-error "'attach' clause argument not pointer or allocatable" "" { = target *-*-* } .-1 } > +!$acc enter data attach(var%bar) > +! { dg-error "'attach' clause argument not pointer or allocatable" "" { = target *-*-* } .-1 } > +!$acc enter data attach(var%qux) > +! { dg-error "'attach' clause argument not pointer or allocatable" "" { = target *-*-* } .-1 } > + > +!$acc serial > +var%foo =3D 5 > +var%bar =3D "GOODBYE!" > +var%qux =3D (/ 6, 7, 8, 9, 10 /) > +!$acc end serial > + > +!$acc exit data detach(var%qux) > +! { dg-error "'detach' clause argument not pointer or allocatable" "" { = target *-*-* } .-1 } > +!$acc exit data detach(var%bar) > +! { dg-error "'detach' clause argument not pointer or allocatable" "" { = target *-*-* } .-1 } > +!$acc exit data detach(var%foo) > +! { dg-error "'detach' clause argument not pointer or allocatable" "" { = target *-*-* } .-1 } > + > +!$acc exit data copyout(var) > + > +if (var%foo.ne.5) stop 1 > +if (var%bar.ne."GOODBYE!") stop 2 > + > +end ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955