From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 04D833858C78; Tue, 1 Mar 2022 09:18:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 04D833858C78 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.90,145,1643702400"; d="scan'208";a="75110580" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 01 Mar 2022 01:18:02 -0800 IronPort-SDR: +KNKvWBPrfZJxcJLfeaSGi7vol0I0JH6dnc7STuuey1DjXtF5R7i66apWAdkJA/BFu/kp4yVjX 9IF5+JXtgmD+c6Uxb9nPrJKwo1p7Yn6dq+16QPzwk1+JwYZoiMZrn86MGU9vJb/42FQByFnD1K XXYiLZip2G1jfqTdnDHnFOF0R12fqOuIiXX3AIGjj1jv+ZmVnAuam3JT/oEvpVL3C19Aci+NjF 0jlJCgYYqGOSWwGNTTeuaa0Q+OtNfi8MfCMv8mZZ1+Z3Tr074wAfNT8Lo9pWzaW05BcaRbsPJr wR0= Message-ID: <14be1163-51e6-19bd-0032-c18a53ffe254@codesourcery.com> Date: Tue, 1 Mar 2022 10:17:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH] openmp, fortran: Check that event handles passed to detach clauses are not arrays [PR104131] Content-Language: en-US To: Jakub Jelinek CC: Mikael Morin , , Kwok Cheung Yeung , gcc-patches , fortran References: <383792f1-a5c7-af10-c603-2f1332336648@codesourcery.com> <3c2d161f-481a-b223-a855-cadee01a5679@orange.fr> <8981ebb8-7b8e-19d7-a3b3-ef5fce239c53@orange.fr> <907e1f89-4534-75e4-fdb8-a11da280e3d1@orange.fr> <65456330-dc81-0647-3bdb-6d409554136d@codesourcery.com> From: Tobias Burnus In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-05.mgc.mentorg.com (139.181.222.5) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: 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: , X-List-Received-Date: Tue, 01 Mar 2022 09:18:04 -0000 First, thanks for looking into the standard. I think the information is too much spread through the standard. I keep searching for restrictions, find them at 5 places and miss another 5. With OpenMP 5.2, it became even worse. On 01.03.22 09:16, Jakub Jelinek wrote: > As there is no explicit allowing of array sections, array sections aren't > allowed in detach, and it must be scalar integer. > The question is if a non-coindexed coarray is a scalar integer variable o= r > not. I think the Fortran sense, yes. That only coindexed vars are disallowed also implies this in the OpenMP spec. In terms of the implementation, a local part of a coarray is really not much different from any other variable, except that all coarrays have to be either in static memory or allocatables/pointers (which are collectively allocated). For a non-descriptor variable like: program main integer, save :: a[*] call foo(a) contains subroutine foo(x) integer :: x[*] end end That's also the case for the internal representation: static void * restrict caf_token.2; static integer(kind=3D4) * restrict a; void foo (integer(kind=3D4) * restrict x, void * restrict caf_token.0, integer(kind=3D8) caf_offset.1) 'x' is a pretty normal variable (admittedly, internally now a pointer) which can be used like a noncoarray. (The pointer is there to permit to put the var into some special, remote accessible memory.) Tobias ----------------- 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