From patchwork Fri Jun 30 19:23:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 1802125 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Qt4z20vnVz20ZL for ; Sat, 1 Jul 2023 05:25:18 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 419E33889824 for ; Fri, 30 Jun 2023 19:24:53 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 32BD7385841A; Fri, 30 Jun 2023 19:24:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 32BD7385841A 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="6.01,171,1684828800"; d="scan'208";a="11765201" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 30 Jun 2023 11:24:18 -0800 IronPort-SDR: qZ7vFXBJwLGq/0Ei/4ABiJa4GFHiEl/eZJm927s6KizL0EUqv/C0zgn8aD0xH/BRDNqHSkVAJj VUy2QmwqzK9W+a38dGcRgOmIeW2IGbLqPKLwzv6M4qzYqOGUSY9czhg+SswdD6ggz1gCcz7E81 SyNX8olfajx4HkfmDvT76vM7+qkXp5W4WeVoOP/xJOLiPSTHsazZg3HgfRMjLT+IJiTxuWGeju /wnzY/aoPSyaVzi/M+AxAUq47WEQmikAHk4kP6ghJrWAvKMdNaiYkVmBgHroC2fFg/G7Rrij7L XPc= From: Julian Brown To: CC: , Tobias Burnus , Subject: [PATCH 0/7] [og13] OpenMP: lvalue parsing and "declare mapper" support Date: Fri, 30 Jun 2023 19:23:27 +0000 Message-ID: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) X-Spam-Status: No, score=-5.7 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 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: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" This patch series provides generalised lvalue ("locator list item") parsing for OpenMP "map", "to" and "from" clauses for C and C++, and "declare mapper" support for C, C++ and Fortran. It is based on the latter part of the patch series sent upstream previously: https://gcc.gnu.org/pipermail/gcc-patches/2022-December/609031.html (parts 7, 8, 9, 10 and 11), with adjustments necessary due to other patches already on og13 and also a few follow-up fixes. Tested with offloading to AMD GCN. I will apply (to og13) shortly. Julian Brown (7): Fix up merge/formatting errors OpenMP: OpenMP 5.2 semantics for pointers with unmapped target OpenMP: lvalue parsing for map/to/from clauses (C++) OpenMP: C++ "declare mapper" support OpenMP: lvalue parsing for map clauses (C) OpenMP: Support OpenMP 5.0 "declare mapper" directives for C OpenMP: Fortran "!$omp declare mapper" support gcc/c-family/c-common.h | 7 +- gcc/c-family/c-omp.cc | 323 +- gcc/c-family/c-pretty-print.cc | 12 + gcc/c/c-decl.cc | 169 + gcc/c/c-objc-common.h | 12 + gcc/c/c-parser.cc | 463 ++- gcc/c/c-tree.h | 10 + gcc/c/c-typeck.cc | 128 +- gcc/cp/constexpr.cc | 10 + gcc/cp/cp-gimplify.cc | 6 + gcc/cp/cp-objcp-common.h | 9 + gcc/cp/cp-tree.h | 19 +- gcc/cp/decl.cc | 27 +- gcc/cp/decl2.cc | 54 +- gcc/cp/error.cc | 34 + gcc/cp/parser.cc | 497 ++- gcc/cp/parser.h | 3 + gcc/cp/pt.cc | 78 +- gcc/cp/semantics.cc | 261 +- gcc/cp/typeck.cc | 50 + gcc/fortran/dump-parse-tree.cc | 4 + gcc/fortran/f95-lang.cc | 7 + gcc/fortran/gfortran.h | 56 +- gcc/fortran/match.cc | 9 +- gcc/fortran/match.h | 1 + gcc/fortran/module.cc | 251 +- gcc/fortran/openmp.cc | 299 +- gcc/fortran/parse.cc | 18 +- gcc/fortran/resolve.cc | 2 + gcc/fortran/st.cc | 2 +- gcc/fortran/symbol.cc | 16 + gcc/fortran/trans-decl.cc | 33 +- gcc/fortran/trans-openmp.cc | 785 +++- gcc/fortran/trans-stmt.h | 1 + gcc/fortran/trans.h | 3 + gcc/gimplify.cc | 583 ++- gcc/langhooks-def.h | 13 + gcc/langhooks.cc | 35 + gcc/langhooks.h | 16 + gcc/omp-general.h | 86 + .../c-c++-common/gomp/declare-mapper-12.c | 22 + .../c-c++-common/gomp/declare-mapper-3.c | 30 + .../c-c++-common/gomp/declare-mapper-4.c | 78 + .../c-c++-common/gomp/declare-mapper-5.c | 26 + .../c-c++-common/gomp/declare-mapper-6.c | 23 + .../c-c++-common/gomp/declare-mapper-7.c | 29 + .../c-c++-common/gomp/declare-mapper-8.c | 43 + .../c-c++-common/gomp/declare-mapper-9.c | 34 + gcc/testsuite/c-c++-common/gomp/map-6.c | 14 +- gcc/testsuite/g++.dg/gomp/array-section-1.C | 38 + gcc/testsuite/g++.dg/gomp/array-section-2.C | 63 + .../g++.dg/gomp/bad-array-section-1.C | 35 + .../g++.dg/gomp/bad-array-section-10.C | 35 + .../g++.dg/gomp/bad-array-section-11.C | 36 + .../g++.dg/gomp/bad-array-section-2.C | 33 + .../g++.dg/gomp/bad-array-section-3.C | 28 + .../g++.dg/gomp/bad-array-section-4.C | 50 + .../g++.dg/gomp/bad-array-section-5.C | 50 + .../g++.dg/gomp/bad-array-section-6.C | 24 + .../g++.dg/gomp/bad-array-section-7.C | 36 + .../g++.dg/gomp/bad-array-section-8.C | 53 + .../g++.dg/gomp/bad-array-section-9.C | 39 + gcc/testsuite/g++.dg/gomp/declare-mapper-1.C | 58 + gcc/testsuite/g++.dg/gomp/declare-mapper-2.C | 30 + .../gomp/has_device_addr-non-lvalue-1.C | 36 + gcc/testsuite/g++.dg/gomp/ind-base-3.C | 37 + gcc/testsuite/g++.dg/gomp/map-assignment-1.C | 12 + gcc/testsuite/g++.dg/gomp/map-inc-1.C | 10 + gcc/testsuite/g++.dg/gomp/map-lvalue-ref-1.C | 19 + gcc/testsuite/g++.dg/gomp/map-ptrmem-1.C | 37 + gcc/testsuite/g++.dg/gomp/map-ptrmem-2.C | 40 + .../g++.dg/gomp/map-static-cast-lvalue-1.C | 17 + gcc/testsuite/g++.dg/gomp/map-ternary-1.C | 20 + gcc/testsuite/g++.dg/gomp/member-array-2.C | 91 + gcc/testsuite/g++.dg/gomp/pr67522.C | 2 +- .../gcc.dg/gomp/bad-array-section-c-1.c | 16 + .../gcc.dg/gomp/bad-array-section-c-2.c | 13 + .../gcc.dg/gomp/bad-array-section-c-3.c | 24 + .../gcc.dg/gomp/bad-array-section-c-4.c | 26 + .../gcc.dg/gomp/bad-array-section-c-5.c | 15 + .../gcc.dg/gomp/bad-array-section-c-6.c | 16 + .../gcc.dg/gomp/bad-array-section-c-7.c | 26 + .../gcc.dg/gomp/bad-array-section-c-8.c | 21 + gcc/testsuite/gcc.dg/gomp/declare-mapper-10.c | 61 + gcc/testsuite/gcc.dg/gomp/declare-mapper-11.c | 33 + .../gfortran.dg/gomp/declare-mapper-1.f90 | 71 + .../gfortran.dg/gomp/declare-mapper-14.f90 | 26 + .../gfortran.dg/gomp/declare-mapper-5.f90 | 45 + gcc/tree-core.h | 4 + gcc/tree-pretty-print.cc | 58 + gcc/tree.cc | 2 + gcc/tree.def | 10 + gcc/tree.h | 19 + include/gomp-constants.h | 11 +- libgomp/target.c | 7 +- libgomp/testsuite/libgomp.c++/baseptrs-4.C | 26 +- libgomp/testsuite/libgomp.c++/baseptrs-6.C | 3199 +++++++++++++++++ .../testsuite/libgomp.c++/declare-mapper-1.C | 87 + .../testsuite/libgomp.c++/declare-mapper-2.C | 55 + .../testsuite/libgomp.c++/declare-mapper-3.C | 63 + .../testsuite/libgomp.c++/declare-mapper-4.C | 63 + .../testsuite/libgomp.c++/declare-mapper-5.C | 52 + .../testsuite/libgomp.c++/declare-mapper-6.C | 37 + .../testsuite/libgomp.c++/declare-mapper-7.C | 48 + .../testsuite/libgomp.c++/declare-mapper-8.C | 61 + libgomp/testsuite/libgomp.c++/ind-base-1.C | 162 + libgomp/testsuite/libgomp.c++/ind-base-2.C | 93 + .../testsuite/libgomp.c++/lvalue-tofrom-1.C | 75 + .../testsuite/libgomp.c++/lvalue-tofrom-2.C | 71 + libgomp/testsuite/libgomp.c++/map-comma-1.C | 15 + .../testsuite/libgomp.c++/map-rvalue-ref-1.C | 22 + libgomp/testsuite/libgomp.c++/struct-ref-1.C | 97 + .../testsuite/libgomp.c++/target-lambda-1.C | 5 +- libgomp/testsuite/libgomp.c++/target-this-3.C | 11 +- libgomp/testsuite/libgomp.c++/target-this-4.C | 11 +- .../libgomp.c-c++-common/array-field-1.c | 35 + .../libgomp.c-c++-common/array-of-struct-1.c | 65 + .../libgomp.c-c++-common/array-of-struct-2.c | 65 + .../libgomp.c-c++-common/declare-mapper-10.c | 60 + .../libgomp.c-c++-common/declare-mapper-11.c | 59 + .../libgomp.c-c++-common/declare-mapper-12.c | 87 + .../libgomp.c-c++-common/declare-mapper-13.c | 55 + .../libgomp.c-c++-common/declare-mapper-14.c | 57 + .../libgomp.c-c++-common/declare-mapper-9.c | 62 + .../libgomp.c-c++-common/ind-base-4.c | 50 + .../libgomp.c-c++-common/unary-ptr-1.c | 16 + .../libgomp.fortran/declare-mapper-10.f90 | 40 + .../libgomp.fortran/declare-mapper-11.f90 | 38 + .../libgomp.fortran/declare-mapper-12.f90 | 33 + .../libgomp.fortran/declare-mapper-13.f90 | 49 + .../libgomp.fortran/declare-mapper-15.f90 | 24 + .../libgomp.fortran/declare-mapper-17.f90 | 92 + .../libgomp.fortran/declare-mapper-18.f90 | 46 + .../libgomp.fortran/declare-mapper-19.f90 | 29 + .../libgomp.fortran/declare-mapper-2.f90 | 32 + .../libgomp.fortran/declare-mapper-20.f90 | 29 + .../libgomp.fortran/declare-mapper-21.f90 | 24 + .../libgomp.fortran/declare-mapper-3.f90 | 33 + .../libgomp.fortran/declare-mapper-4.f90 | 36 + .../libgomp.fortran/declare-mapper-6.f90 | 28 + .../libgomp.fortran/declare-mapper-7.f90 | 29 + .../libgomp.fortran/declare-mapper-8.f90 | 115 + .../libgomp.fortran/declare-mapper-9.f90 | 27 + 143 files changed, 11422 insertions(+), 270 deletions(-) create mode 100644 gcc/testsuite/c-c++-common/gomp/declare-mapper-12.c create mode 100644 gcc/testsuite/c-c++-common/gomp/declare-mapper-3.c create mode 100644 gcc/testsuite/c-c++-common/gomp/declare-mapper-4.c create mode 100644 gcc/testsuite/c-c++-common/gomp/declare-mapper-5.c create mode 100644 gcc/testsuite/c-c++-common/gomp/declare-mapper-6.c create mode 100644 gcc/testsuite/c-c++-common/gomp/declare-mapper-7.c create mode 100644 gcc/testsuite/c-c++-common/gomp/declare-mapper-8.c create mode 100644 gcc/testsuite/c-c++-common/gomp/declare-mapper-9.c create mode 100644 gcc/testsuite/g++.dg/gomp/array-section-1.C create mode 100644 gcc/testsuite/g++.dg/gomp/array-section-2.C create mode 100644 gcc/testsuite/g++.dg/gomp/bad-array-section-1.C create mode 100644 gcc/testsuite/g++.dg/gomp/bad-array-section-10.C create mode 100644 gcc/testsuite/g++.dg/gomp/bad-array-section-11.C create mode 100644 gcc/testsuite/g++.dg/gomp/bad-array-section-2.C create mode 100644 gcc/testsuite/g++.dg/gomp/bad-array-section-3.C create mode 100644 gcc/testsuite/g++.dg/gomp/bad-array-section-4.C create mode 100644 gcc/testsuite/g++.dg/gomp/bad-array-section-5.C create mode 100644 gcc/testsuite/g++.dg/gomp/bad-array-section-6.C create mode 100644 gcc/testsuite/g++.dg/gomp/bad-array-section-7.C create mode 100644 gcc/testsuite/g++.dg/gomp/bad-array-section-8.C create mode 100644 gcc/testsuite/g++.dg/gomp/bad-array-section-9.C create mode 100644 gcc/testsuite/g++.dg/gomp/declare-mapper-1.C create mode 100644 gcc/testsuite/g++.dg/gomp/declare-mapper-2.C create mode 100644 gcc/testsuite/g++.dg/gomp/has_device_addr-non-lvalue-1.C create mode 100644 gcc/testsuite/g++.dg/gomp/ind-base-3.C create mode 100644 gcc/testsuite/g++.dg/gomp/map-assignment-1.C create mode 100644 gcc/testsuite/g++.dg/gomp/map-inc-1.C create mode 100644 gcc/testsuite/g++.dg/gomp/map-lvalue-ref-1.C create mode 100644 gcc/testsuite/g++.dg/gomp/map-ptrmem-1.C create mode 100644 gcc/testsuite/g++.dg/gomp/map-ptrmem-2.C create mode 100644 gcc/testsuite/g++.dg/gomp/map-static-cast-lvalue-1.C create mode 100644 gcc/testsuite/g++.dg/gomp/map-ternary-1.C create mode 100644 gcc/testsuite/g++.dg/gomp/member-array-2.C create mode 100644 gcc/testsuite/gcc.dg/gomp/bad-array-section-c-1.c create mode 100644 gcc/testsuite/gcc.dg/gomp/bad-array-section-c-2.c create mode 100644 gcc/testsuite/gcc.dg/gomp/bad-array-section-c-3.c create mode 100644 gcc/testsuite/gcc.dg/gomp/bad-array-section-c-4.c create mode 100644 gcc/testsuite/gcc.dg/gomp/bad-array-section-c-5.c create mode 100644 gcc/testsuite/gcc.dg/gomp/bad-array-section-c-6.c create mode 100644 gcc/testsuite/gcc.dg/gomp/bad-array-section-c-7.c create mode 100644 gcc/testsuite/gcc.dg/gomp/bad-array-section-c-8.c create mode 100644 gcc/testsuite/gcc.dg/gomp/declare-mapper-10.c create mode 100644 gcc/testsuite/gcc.dg/gomp/declare-mapper-11.c create mode 100644 gcc/testsuite/gfortran.dg/gomp/declare-mapper-1.f90 create mode 100644 gcc/testsuite/gfortran.dg/gomp/declare-mapper-14.f90 create mode 100644 gcc/testsuite/gfortran.dg/gomp/declare-mapper-5.f90 create mode 100644 libgomp/testsuite/libgomp.c++/baseptrs-6.C create mode 100644 libgomp/testsuite/libgomp.c++/declare-mapper-1.C create mode 100644 libgomp/testsuite/libgomp.c++/declare-mapper-2.C create mode 100644 libgomp/testsuite/libgomp.c++/declare-mapper-3.C create mode 100644 libgomp/testsuite/libgomp.c++/declare-mapper-4.C create mode 100644 libgomp/testsuite/libgomp.c++/declare-mapper-5.C create mode 100644 libgomp/testsuite/libgomp.c++/declare-mapper-6.C create mode 100644 libgomp/testsuite/libgomp.c++/declare-mapper-7.C create mode 100644 libgomp/testsuite/libgomp.c++/declare-mapper-8.C create mode 100644 libgomp/testsuite/libgomp.c++/ind-base-1.C create mode 100644 libgomp/testsuite/libgomp.c++/ind-base-2.C create mode 100644 libgomp/testsuite/libgomp.c++/lvalue-tofrom-1.C create mode 100644 libgomp/testsuite/libgomp.c++/lvalue-tofrom-2.C create mode 100644 libgomp/testsuite/libgomp.c++/map-comma-1.C create mode 100644 libgomp/testsuite/libgomp.c++/map-rvalue-ref-1.C create mode 100644 libgomp/testsuite/libgomp.c++/struct-ref-1.C create mode 100644 libgomp/testsuite/libgomp.c-c++-common/array-field-1.c create mode 100644 libgomp/testsuite/libgomp.c-c++-common/array-of-struct-1.c create mode 100644 libgomp/testsuite/libgomp.c-c++-common/array-of-struct-2.c create mode 100644 libgomp/testsuite/libgomp.c-c++-common/declare-mapper-10.c create mode 100644 libgomp/testsuite/libgomp.c-c++-common/declare-mapper-11.c create mode 100644 libgomp/testsuite/libgomp.c-c++-common/declare-mapper-12.c create mode 100644 libgomp/testsuite/libgomp.c-c++-common/declare-mapper-13.c create mode 100644 libgomp/testsuite/libgomp.c-c++-common/declare-mapper-14.c create mode 100644 libgomp/testsuite/libgomp.c-c++-common/declare-mapper-9.c create mode 100644 libgomp/testsuite/libgomp.c-c++-common/ind-base-4.c create mode 100644 libgomp/testsuite/libgomp.c-c++-common/unary-ptr-1.c create mode 100644 libgomp/testsuite/libgomp.fortran/declare-mapper-10.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/declare-mapper-11.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/declare-mapper-12.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/declare-mapper-13.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/declare-mapper-15.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/declare-mapper-17.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/declare-mapper-18.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/declare-mapper-19.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/declare-mapper-2.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/declare-mapper-20.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/declare-mapper-21.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/declare-mapper-3.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/declare-mapper-4.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/declare-mapper-6.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/declare-mapper-7.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/declare-mapper-8.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/declare-mapper-9.f90