From patchwork Sun Oct 9 21:51:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 54 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1309121wrs; Sun, 9 Oct 2022 14:53:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6OO1JfNAycue5RR675IBzLjYxOkAmbMGSUInFzcX15uT7C4zflnCpF+FrwhrcJrZPCXiCo X-Received: by 2002:a05:6402:d0b:b0:458:a244:4e99 with SMTP id eb11-20020a0564020d0b00b00458a2444e99mr14852837edb.46.1665352394689; Sun, 09 Oct 2022 14:53:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665352394; cv=none; d=google.com; s=arc-20160816; b=A5sWs1iKgET/W8j4VyL+zIhfIlyrCB1xY/cJigntEJRAy2DLIsUqjgtij/GvKFdWbZ ih+0VvvGXsYfMMeCTrkJ/qVaMIsejP3krE8HiBXx9s+GbX6YXZ+bdWnMl4wXAT3exhnU +5E2Yj2Y6tCf8ab3Y8whrvqc69H3C7aiRPQebDOmFJdjYV2/pHJGt+rkEl4/TKUyoRux ad30VWaNDi7pJjh/P7ob5FWkdB3c2zd1QwX6rR1pF8888zAEdEAHcRbO0gZywJWnCG7Z qjRm9sP0TR5N/eZZKgebSCJqS5ZhOJh5HHEiHfH6NSiTlWcj1qvPNxZrskGMsEvFHnGh t3DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:ironport-sdr :dmarc-filter:delivered-to; bh=5h5Q9Yj8KQqrt4SBiln24/VVANgXlFIKY8s+9SOK9No=; b=sjBFDLyEy0HUlMK7Rim2qa+4EfaPKYOeHE2kRA84Z+sbF+mMAfN+HZzexOLRXiAkoj I4nxnCHIhPtyCTQxmgIiX7lBsiePXfCndODjsfGVSH74JsGPs6hT/d7CZ9R58fBEPxZH P1yjsf344sH8+n2Sactq9kvs1MHx9zEMvnsMGVrk6bTRW/qa6HTXyQedUFLU2N+wkw2Z rrf/tXg43qtAl77KbGI2qM5zgfqhEalsizvubOx6AX8KJ93sfxhaumoq0bU6HBbvVHJh RZMozEibnkVenfUhf2oTZfPComWcxdqJef/M0QtoR4plItOwuKL9quW1Kvp2EonJgb3Y UdVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id z18-20020a05640240d200b00458e87a1d83si9342358edb.54.2022.10.09.14.53.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Oct 2022 14:53:14 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EF59D385AE5F for ; Sun, 9 Oct 2022 21:52:14 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id A0B763858D1E; Sun, 9 Oct 2022 21:51:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A0B763858D1E 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.95,172,1661846400"; d="scan'208";a="84258938" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 09 Oct 2022 13:51:47 -0800 IronPort-SDR: h8XVWLRw0T/Oa4/kRe7OIVasJ2Tm2Q4tPZHSezngu+iYM73xmL/kH9nw2RQ9owAPXbWRFVK5gK RGlqEv4k1lGDfwpOus8tKXzMUk9v5QMTUi61DuVb6iuZlX045Y1jVZV3Cp3uJJQ6V/HmtxSDmR A57fOw9S/Ii5L61qJuM15QM2fSPF5kQZmsg1psxcKaKlo7xvl80EGRzq/wI2W+AZHlctyy+R1p 3sS8uN12ISTbTM5BPMS6rUoyNNICW0gRlRe/9bOX/gh4uvjomCal1fPH73Ncs7aDf+SkdJObWQ VX0= From: Julian Brown To: Subject: [PATCH v4 0/4] Fortran pointers and unordered structs Date: Sun, 9 Oct 2022 14:51:33 -0700 Message-ID: X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) To svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) 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 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: , Cc: Jakub Jelinek , Tobias Burnus , fortran@gcc.gnu.org Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746248552440744996?= X-GMAIL-MSGID: =?utf-8?q?1746248552440744996?= This series replaces parts 6-8 in the series: https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601549.html Investigating some of Tobias's questions regarding part 6/11 ("OpenMP: Pointers and member mappings") in that series, I realised that sorting of struct components with non-constant offsets was broken, and that was affecting some of the new Fortran tests I was adding. The new patch in this series (4/4 "OpenMP/OpenACC: Unordered/non-constant component offset struct mapping") addresses that problem by introducing a new unordered struct mapping kind, GOMP_MAP_STRUCT_UNORD. Tested with offloading to NVPTX. OK? Julian Brown (4): OpenMP: Pointers and member mappings OpenMP/OpenACC: Reindent TO/FROM/_CACHE_ stanza in {c_}finish_omp_clause OpenMP/OpenACC: Rework clause expansion and nested struct handling OpenMP/OpenACC: Unordered/non-constant component offset struct mapping gcc/c-family/c-common.h | 70 + gcc/c-family/c-omp.cc | 766 +++- gcc/c/c-typeck.cc | 732 ++-- gcc/cp/semantics.cc | 1013 +++--- gcc/fortran/dependency.cc | 128 + gcc/fortran/dependency.h | 1 + gcc/fortran/gfortran.h | 1 + gcc/fortran/trans-openmp.cc | 238 +- gcc/gimplify.cc | 1124 +++++- gcc/omp-general.cc | 425 +++ gcc/omp-general.h | 69 + gcc/omp-low.cc | 8 +- gcc/testsuite/c-c++-common/gomp/clauses-2.c | 2 +- gcc/testsuite/c-c++-common/gomp/target-50.c | 2 +- .../c-c++-common/gomp/target-implicit-map-2.c | 2 +- .../g++.dg/gomp/static-component-1.C | 23 + gcc/testsuite/gcc.dg/gomp/target-3.c | 2 +- gcc/tree-pretty-print.cc | 3 + gcc/tree.h | 4 + include/gomp-constants.h | 9 + libgomp/oacc-mem.c | 6 +- libgomp/target.c | 183 +- libgomp/testsuite/libgomp.c++/baseptrs-3.C | 275 ++ libgomp/testsuite/libgomp.c++/baseptrs-4.C | 3154 +++++++++++++++++ libgomp/testsuite/libgomp.c++/baseptrs-5.C | 62 + libgomp/testsuite/libgomp.c++/class-array-1.C | 59 + libgomp/testsuite/libgomp.c++/target-48.C | 32 + libgomp/testsuite/libgomp.c++/target-49.C | 37 + .../libgomp.c-c++-common/baseptrs-1.c | 50 + .../libgomp.c-c++-common/baseptrs-2.c | 70 + .../map-arrayofstruct-1.c | 38 + .../map-arrayofstruct-2.c | 54 + .../map-arrayofstruct-3.c | 64 + libgomp/testsuite/libgomp.c/target-22.c | 3 +- .../libgomp.fortran/map-subarray-2.f90 | 108 + .../libgomp.fortran/map-subarray-3.f90 | 48 + .../libgomp.fortran/map-subarray-4.f90 | 35 + .../libgomp.fortran/map-subarray-5.f90 | 50 + .../libgomp.fortran/map-subarray-6.f90 | 26 + .../libgomp.fortran/map-subarray.f90 | 33 + .../libgomp.fortran/map-subcomponents.f90 | 32 + .../libgomp.fortran/struct-elem-map-1.f90 | 10 +- 42 files changed, 7868 insertions(+), 1183 deletions(-) create mode 100644 gcc/testsuite/g++.dg/gomp/static-component-1.C create mode 100644 libgomp/testsuite/libgomp.c++/baseptrs-3.C create mode 100644 libgomp/testsuite/libgomp.c++/baseptrs-4.C create mode 100644 libgomp/testsuite/libgomp.c++/baseptrs-5.C create mode 100644 libgomp/testsuite/libgomp.c++/class-array-1.C create mode 100644 libgomp/testsuite/libgomp.c++/target-48.C create mode 100644 libgomp/testsuite/libgomp.c++/target-49.C create mode 100644 libgomp/testsuite/libgomp.c-c++-common/baseptrs-1.c create mode 100644 libgomp/testsuite/libgomp.c-c++-common/baseptrs-2.c create mode 100644 libgomp/testsuite/libgomp.c-c++-common/map-arrayofstruct-1.c create mode 100644 libgomp/testsuite/libgomp.c-c++-common/map-arrayofstruct-2.c create mode 100644 libgomp/testsuite/libgomp.c-c++-common/map-arrayofstruct-3.c create mode 100644 libgomp/testsuite/libgomp.fortran/map-subarray-2.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/map-subarray-3.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/map-subarray-4.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/map-subarray-5.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/map-subarray-6.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/map-subarray.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/map-subcomponents.f90