From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 42B7E3858D3C; Fri, 4 Feb 2022 15:33:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 42B7E3858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: yBtHjflzDNU9apDi3uUMOeiZwv/08htGmsEdueFFW3rZLmRD4y8LOGGOZU0GCjKiShKoj24YIZ 6j79es8SFYa2WXInJKfGUS+Mtwc2nd4KlxcPp8gun+zhJ7K27t0Myw3773ygtTn1bIawpbgFuG VgjSR2jX+U17Wn52lpw5aCPwxut4msVPB2mxgVIkpsPWYWDuGGWC6v5TfJwcHT8WgsurMwa+Zy 8JY8+exYVSBTHe6jg4wMt8TUoY3VXmMC1OOPHBgLq3PRFD1XZfy15CkRZFZWmJU+2nZDW7S6qA jr8iHxP/AcCE/e+vyfvWwVQo X-IronPort-AV: E=Sophos;i="5.88,343,1635235200"; d="scan'208";a="71613927" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 04 Feb 2022 07:33:06 -0800 IronPort-SDR: rPFWxuGRu9TAxKQa0jPHSQlz0nVyBRD29Gdb9ahzubBcEPd+4faymawBqjX7E7aSDRruCXpq4C QYg91pJ4wxox0ff/swotfMlcH0HQRvLy5MXkT5AKONKrombFqqZ5qwi+4jSDNwP+GSDUPqcxN0 erPKL1R9Pzn2bu5U9ThdSZC9PUGVr0fsnrsNng5Ckom8rn2MCC9EFCJFZ3iCBHnGSjkLh5IfTx i3QtPkAip0d35k5LWx6z5/jfO9C0hndEgFQDaYU6KDQKuATuWzlG1PenA8ey01ROjwKbAcRSUg gmM= From: Thomas Schwinge To: Tobias Burnus CC: Hafiz Abid Qadeer , Jakub Jelinek , , Subject: Re: [committed] libgomp.fortran/allocate-1.f90: Minor cleanup (was: Re: [PATCH] [gfortran] Add support for allocate clause (OpenMP 5.0).) In-Reply-To: <195b52d9-0071-1801-dfd0-041d794e93a4@codesourcery.com> References: <20211022130502.2211568-1-abidh@codesourcery.com> <20211102162714.GF304296@tucnak> <20211220200650.GN2646553@tucnak> <8735lh6mcx.fsf@euler.schwinge.homeip.net> <48d8c123-fa4f-d4a3-17de-b082de32f0bf@codesourcery.com> <87mtj7rn02.fsf@euler.schwinge.homeip.net> <195b52d9-0071-1801-dfd0-041d794e93a4@codesourcery.com> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Fri, 4 Feb 2022 16:33:00 +0100 Message-ID: <87ee4isl3n.fsf@euler.schwinge.homeip.net> 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-11.mgc.mentorg.com (139.181.222.11) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Feb 2022 15:33:10 -0000 Hi Tobias! On 2022-02-04T14:57:07+0100, Tobias Burnus wrote: > On 04.02.22 10:37, Thomas Schwinge wrote: >>> I have attached a patch (not commited), which silences the three kind o= f >>> warnings and fixes the interface issue. >>> TODO: commit it. >> Still "TODO: commit it" ;-) -- and while I haven't reviewed the changes >> in detail, I did spot one item that should be addressed, I suppose: > > I had also spotted the 'stop' which was a left over from -fsanitized=3D..= . > checking and had removed it locally. Maybe removed locally, I can't tell ;-) -- but it's still in the commit that you pushed. See below. Also, a commented-out '!$omp barrier'; not sure what that one is about. > But good that you also keep > checking patches :-) I try! :-) Gr=C3=BC=C3=9Fe Thomas > In any case, I have now _finally_ committed the patch. > > Attached is the simplified (-w) diff, where I did exclude the > indentation changes to make the diff more readable. > > For the full diff, see e.g. https://gcc.gnu.org/r12-7053 > > Tobias > commit 6d4981350168f1eb3f72149bd7e05b9ba6bec1fd > Author: Tobias Burnus > Date: Fri Feb 4 14:51:01 2022 +0100 > > libgomp.fortran/allocate-1.f90: Minor cleanup > > libgomp/ChangeLog: > * testsuite/libgomp.fortran/allocate-1.c (is_64bit_aligned): = Renamed > from is_64bit_aligned_. > * testsuite/libgomp.fortran/allocate-1.f90: Fix interface dec= l > and use it, more implicit none, remove unused argument. > > diff --git a/libgomp/testsuite/libgomp.fortran/allocate-1.c b/libgomp/tes= tsuite/libgomp.fortran/allocate-1.c > index d33acc6feef..cb6d355afc6 100644 > --- a/libgomp/testsuite/libgomp.fortran/allocate-1.c > +++ b/libgomp/testsuite/libgomp.fortran/allocate-1.c > @@ -1,7 +1,7 @@ > #include > > int > -is_64bit_aligned_ (uintptr_t a) > +is_64bit_aligned (uintptr_t a) > { > return ( (a & 0x3f) =3D=3D 0); > } > diff --git a/libgomp/testsuite/libgomp.fortran/allocate-1.f90 b/libgomp/t= estsuite/libgomp.fortran/allocate-1.f90 > index 35d1750b878..062278f9908 100644 > --- a/libgomp/testsuite/libgomp.fortran/allocate-1.f90 > +++ b/libgomp/testsuite/libgomp.fortran/allocate-1.f90 > @@ -5,30 +5,30 @@ > module m > use omp_lib > use iso_c_binding > - implicit none > + implicit none (type, external) > > interface > integer(c_int) function is_64bit_aligned (a) bind(C) > import :: c_int > - integer :: a > + type(*) :: a > end > end interface > -end module m > > -subroutine foo (x, p, q, px, h, fl) > +contains > + > +subroutine foo (x, p, q, h, fl) > use omp_lib > use iso_c_binding > integer :: x > integer, dimension(4) :: p > integer, dimension(4) :: q > - integer :: px > integer (kind=3Domp_allocator_handle_kind) :: h > integer :: fl > > integer :: y > integer :: r, i, i1, i2, i3, i4, i5 > integer :: l, l3, l4, l5, l6 > - integer :: n, n1, n2, n3, n4 > + integer :: n, n2, n3, n4 > integer :: j2, j3, j4 > integer, dimension(4) :: l2 > integer, dimension(4) :: r2 > @@ -74,6 +74,8 @@ subroutine foo (x, p, q, px, h, fl) > if (x /=3D 42) then > stop 1 > end if > + > + !!$omp barrier > v(1) =3D 7 > if ( (and(fl, 2) /=3D 0) .and. & > ((is_64bit_aligned(x) =3D=3D 0) .or. & > @@ -95,7 +97,7 @@ subroutine foo (x, p, q, px, h, fl) > stop 4 > end if > !$omp end parallel > - > +stop > !$omp teams > !$omp parallel private (y) firstprivate (x, w) allocate (h: x, y, w) > > @@ -305,11 +307,13 @@ subroutine foo (x, p, q, px, h, fl) > .or. r2(1) /=3D (5 * p(3)) .or. r2(4) /=3D (6 * p(3))) then > stop 25 > end if > - > end subroutine > +end module m > > program main > use omp_lib > + use m > + implicit none (type, external) > integer, dimension(4) :: p > integer, dimension(4) :: q > > @@ -323,11 +327,11 @@ program main > if (a =3D=3D omp_null_allocator) stop 1 > > call omp_set_default_allocator (omp_default_mem_alloc); > - call foo (42, p, q, 2, a, 0); > - call foo (42, p, q, 2, omp_default_mem_alloc, 0); > - call foo (42, p, q, 2, a, 1); > + call foo (42, p, q, a, 0); > + call foo (42, p, q, omp_default_mem_alloc, 0); > + call foo (42, p, q, a, 1); > call omp_set_default_allocator (a); > - call foo (42, p, q, 2, omp_null_allocator, 3); > - call foo (42, p, q, 2, omp_default_mem_alloc, 2); > + call foo (42, p, q, omp_null_allocator, 3); > + call foo (42, p, q, omp_default_mem_alloc, 2); > call omp_destroy_allocator (a); > 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