From patchwork Tue Oct 18 10:39:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 273 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1882402wrs; Tue, 18 Oct 2022 03:40:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7+YSA1CxQSObCEgnvM4cEgKQbPbu8p/Ap0/Fgw4fWwtBgpmxc2h2JXQ5IiSMJg8E93uks1 X-Received: by 2002:a17:907:7292:b0:78e:2eb5:6af2 with SMTP id dt18-20020a170907729200b0078e2eb56af2mr1844343ejc.261.1666089604058; Tue, 18 Oct 2022 03:40:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666089604; cv=none; d=google.com; s=arc-20160816; b=c09z9cdKJbdqhN/LGIaTzpRzaiF7cPwxVRKfeW/YlkK0kv8DtJOkkIeQn9IBmZEC3M f9+LVzmAXaOE4oOoKaeLlnfmSU3vmaO9OUx3aUbXVLlPwkoR0oQvtIBJQ3eHnv0yCG5l WPYLt6FDfoDpZNdWOwya/YwN+gI8VagHW+F3VuDHVJyeRc4V2r7orfKKiObkfjOmYZSW MB/cbL2eZQ0170QYu3BfQF2O6UkHuUS7UNZZdE7E62nX6liMhn2+BELQJvq0Pu/+YN14 oxb0C6keTAdZErOEsPgO952ZwpMf8t2HlteSx6kPhIILk/7DamKRo5o5dNgXuzF8Jj6w fttQ== 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=raeMA9wx3ur7AfBp3xeMzmQceu7EXXjo7wMhYYRSCdQ=; b=i2CyD+UH5LmbYKgbPYGh1VrlLdvVBNyTf+MrP+PO20LAGSoEimMLghDRwpRqlNwXXh XwWEntVcyuo5DWwrfa7tk2gHl7HqSuAos23fjcyPevXYS1ie5B6n9kcbbiY83yenrql7 7PuOqxz+vt+SFL8RcTbhHMacjkGidsG6o8NkC21yleJ9sZVNPg7bTPsRs4uASS+a4Uk4 c7z8/qyjpAjClxXgTCSuG22c5SpTVsgvU7JdF2Dkcj9vpHk00W+n/otpUHi/Gpn89UcJ Qv6GhpMcnWrnoE2oEHWjKd3qGD2DwqY7yIdS3qhxlQXa/Gs50/pgGOXDpZ2m/RNqbfq/ SQPA== 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 (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id go38-20020a1709070da600b0078d8614e809si12173241ejc.504.2022.10.18.03.40.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 03:40:04 -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 03F613857414 for ; Tue, 18 Oct 2022 10:39:41 +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 88A9B3858C83; Tue, 18 Oct 2022 10:39:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 88A9B3858C83 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,193,1661846400"; d="scan'208";a="84779550" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 18 Oct 2022 02:39:14 -0800 IronPort-SDR: OR2M4cpO+hXOGKqbuyPJy3Os++AVcszdmxOxDd+pci1IZUrf9wJpRZ6pFilS0P5haSXhcGVMBq Kmg012DTE6LcQB5ZIrgU2yeKUhe5a/Xljp8zv8N1ZiXAMzz4A+NEmG4yqCYPpwXO2LiDfrE2UK kOFhqvUF2EtzULkK5sM9+f+vN+y1eti3NDH1mggzRkfhWdLIIrMzcfplqx2iTR2/iE/KoqhXMA TGfICdefJUj0E8/ex9ndSMq0gpKk345PZ9L8r0LACgL5Nvtk5BCg9voLjn5nb2puvUqtkXFMK4 aWc= From: Julian Brown To: Subject: [PATCH v5 0/4] OpenMP/OpenACC: Fortran array descriptor mappings Date: Tue, 18 Oct 2022 03:39:01 -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-08.mgc.mentorg.com (139.181.222.8) 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?1747021572480880693?= X-GMAIL-MSGID: =?utf-8?q?1747021572480880693?= This is a new version of the previously-posted series: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603103.html This version rearranges the patches so the already-approved first two patches come first -- albeit with some XFAILs -- and alters how Fortran array-descriptor mappings work in order to hopefully better handle some corner cases that have come up in previous rounds of patch review (details in patch 3/4). Patch 4/4 no longer sorts "unordered" structs, but instead has been refactored into a runtime check that different elements of the same array (of structs) are not being used for multiple mappings -- for cases where we can't determine if the elements are the same or not at compile time. Retested with offloading to NVPTX. OK? Julian Brown (4): OpenMP/OpenACC: Reindent TO/FROM/_CACHE_ stanza in {c_}finish_omp_clause OpenMP/OpenACC: Rework clause expansion and nested struct handling OpenMP: Pointers and member mappings OpenMP/OpenACC: Unordered/non-constant component offset runtime diagnostic 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 | 272 +- gcc/gimplify.cc | 1178 +++++- 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 | 6 + libgomp/oacc-mem.c | 6 +- libgomp/target.c | 91 +- 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 | 58 + .../map-arrayofstruct-3.c | 68 + libgomp/testsuite/libgomp.c/target-22.c | 3 +- .../libgomp.fortran/map-subarray-2.f90 | 108 + .../libgomp.fortran/map-subarray-3.f90 | 62 + .../libgomp.fortran/map-subarray-4.f90 | 35 + .../libgomp.fortran/map-subarray-5.f90 | 54 + .../libgomp.fortran/map-subarray-6.f90 | 26 + .../libgomp.fortran/map-subarray-7.f90 | 29 + .../libgomp.fortran/map-subarray.f90 | 33 + .../libgomp.fortran/map-subcomponents.f90 | 32 + .../libgomp.fortran/struct-elem-map-1.f90 | 10 +- 43 files changed, 7908 insertions(+), 1191 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-7.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/map-subarray.f90 create mode 100644 libgomp/testsuite/libgomp.fortran/map-subcomponents.f90