From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id E45133858C39; Fri, 14 Jan 2022 09:10:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E45133858C39 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: sInGxAXzd24oIXyTaTbtHFZNCLx6Y68C/4BHpl0ergmNgD7d9k46HM1zEJFbyv6YqztdnYcRSR h+y4hDjcL6Z07FXbvg6kq6Qj8hMNUIJ6WErTvh4xy1shMlZvtJZtXtXhxR9qIRdqIbUDeD959c mSVV4w37As287Y6WaG1qJIFSyZZhxZh9nRtNSAVJhQxFBoE6E6tQ4zefSPzwPqG6aFXUgHndYg RwmKwnVi2XgJVqSslperrrXVU0Om3K3Cq4F2NUrVtSZfM5yCMV0YQJnsoxcZaXJ+ZFiv4ClzeA ftwnHQVasvsVrZGPCzic3ib/ X-IronPort-AV: E=Sophos;i="5.88,288,1635235200"; d="scan'208";a="70630472" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 14 Jan 2022 01:10:21 -0800 IronPort-SDR: /gHJ7p+fa7IR88BhQSQRuzg5wtKH0PM5Db3rPT6r9zwnXODQCE0bPqfKlzEYAZ+fTIunCjHXPR snEIJopojTQu3jnoKy6i9qusK91ghaao3VygTzZVI3P/n5gSa49DjtJZDuhhj0oL8yw6oOup+n g6Q6oLbS4J7cho6fmz90gUV1nqZyAUedViEjVziqrV0/g/6KYFOcte7/k7IR6rdThcHy9sloOc I4ZGiv3u9dwYTc2ZNBoqMhEg9jBLIFzvmMmhgxKHqob0ok+znxgApq9StguZIkxyNDNsG/9dkY RU4= From: Thomas Schwinge To: Hafiz Abid Qadeer CC: Jakub Jelinek , Tobias Burnus , , Subject: Re: [PATCH] [gfortran] Add support for allocate clause (OpenMP 5.0). In-Reply-To: References: <20211022130502.2211568-1-abidh@codesourcery.com> <20211102162714.GF304296@tucnak> <20211220200650.GN2646553@tucnak> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Fri, 14 Jan 2022 10:10:10 +0100 Message-ID: <87bl0evg25.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-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no 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, 14 Jan 2022 09:10:23 -0000 Hi Abid! (Remember to CC for 'gcc/fortran/' etc. changes.) On 2022-01-11T22:31:54+0000, Hafiz Abid Qadeer wro= te: > --- /dev/null > +++ b/gcc/testsuite/gfortran.dg/gomp/allocate-2.f90 > @@ -0,0 +1,45 @@ > +! { dg-do compile } > + > +module omp_lib_kinds > + use iso_c_binding, only: c_int, c_intptr_t > + implicit none > + private :: c_int, c_intptr_t > + integer, parameter :: omp_allocator_handle_kind =3D c_intptr_t > + > +end module > + > +subroutine foo(x) > + use omp_lib_kinds > + implicit none > + integer :: x > + > + !$omp task allocate (x) ! { dg-error "'x' specified in 'allocate' clau= se at .1. but not in an explicit privatization clause" } > + x=3D1 > + !$omp end task > + > + !$omp parallel allocate (x) ! { dg-error "'x' specified in 'allocate' = clause at .1. but not in an explicit privatization clause" } > + x=3D2 > + !$omp end parallel > + > + !$omp parallel allocate (x) shared (x) ! { dg-error "'x' specified in = 'allocate' clause at .1. but not in an explicit privatization clause" } > + x=3D3 > + !$omp end parallel > + > + !$omp parallel private (x) allocate (x) allocate (x) ! { dg-warning "'= x' appears more than once in 'allocate' clauses at .1." } > + x=3D4 > + !$omp end parallel > + > + !$omp parallel private (x) allocate (x, x) ! { dg-warning "'x' appears= more than once in 'allocate' clauses at .1." } > + x=3D5 > + !$omp end parallel > + > + !$omp parallel allocate (0: x) private(x) ! { dg-error "Expected integ= er expression of the 'omp_allocator_handle_kind' kind at .1." } We do for x86_64 default '-m64', but for '-m32' and '-mx32' compilation, we're not seeing this latter diagnostic: PASS: gfortran.dg/gomp/allocate-1.f90 -O (test for excess errors) PASS: gfortran.dg/gomp/allocate-2.f90 -O (test for errors, line 16) PASS: gfortran.dg/gomp/allocate-2.f90 -O (test for errors, line 20) PASS: gfortran.dg/gomp/allocate-2.f90 -O (test for errors, line 24) FAIL: gfortran.dg/gomp/allocate-2.f90 -O (test for errors, line 36) PASS: gfortran.dg/gomp/allocate-2.f90 -O (test for errors, line 40) PASS: gfortran.dg/gomp/allocate-2.f90 -O (test for warnings, line 2= 8) PASS: gfortran.dg/gomp/allocate-2.f90 -O (test for warnings, line 3= 2) PASS: gfortran.dg/gomp/allocate-2.f90 -O (test for excess errors) I suppose the reason is unintended congruence of data types? Would it work to make 'x' a floating-point data type, for example -- or is this meant to explicitly check certain integer data type characteristics? Gr=C3=BC=C3=9Fe Thomas > + x=3D6 > + !$omp end parallel > + > + !$omp parallel private (x) allocate (0.1 : x) ! { dg-error "Expected i= nteger expression of the 'omp_allocator_handle_kind' kind at .1." } > + x=3D7 > + !$omp end parallel > + > +end subroutine ----------------- 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