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 8014839484A9; Fri, 14 May 2021 21:26:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8014839484A9 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Julian_Brown@mentor.com IronPort-SDR: PHPsuPOh7jEHkF/UhB3pta2TzkbmEOydLe34SaQeEag2atmLwAsiZkzaOMLIOcjh4+GPuleJAE CrI3MLAa7H4jFzNT2FHvdTt3CQkTODkkOYkNKl88a0fxz+UluZxmhS3obm0kWSPryrh62+zufD xvEje6ullNqGzilk8Ly4Z6poedwkWY/uaR4Cet3ckeaGkWPqIuqM8sj/KoiT1V4x4RzQmILh3q OezyGUxRNIIGxPurfLgIFGMJyxSD8hGsVtt3nf/CRsXeAkjbqRW0aiwQTpD1XzAu0eIZYd4PwH hqs= X-IronPort-AV: E=Sophos;i="5.82,300,1613462400"; d="scan'208";a="61232134" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 14 May 2021 13:26:54 -0800 IronPort-SDR: 9KRfGuGzQ9UQXqiBo6u23c6Dz9fcS1eOcquErdsAMA1OPj30O6y/RauRddrytRwO67hp3+Uqc/ a0t92COTxcOo+iz6xPIQIkA/C7+P7LzblqEeZ8ilEehnKD6SPL56ZpiSk6+w4x7igdeJMIKBcs 1RXd4EyWP/mvDVjCqH/jAiC+2Yk8Rh9NGNYG/KbnpWrPhozXojrY2mkXL5LM+2Z9SJnl97l6gX 3hBfrxEWw/he8mhJeVnd/wCA1lQ740RZrPNUt0WiYuJyzZ+ytmtKl+ze8P1Maz6cnAW6j2OlYF fjM= From: Julian Brown To: CC: , Jakub Jelinek , Tobias Burnus , Thomas Schwinge , Chung-Lin Tang Subject: [PATCH 3/5] Rewrite GOMP_MAP_ATTACH_DETACH mappings for OpenMP also Date: Fri, 14 May 2021 14:26:25 -0700 Message-ID: X-Mailer: git-send-email 2.29.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-06.mgc.mentorg.com (139.181.222.6) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Fri, 14 May 2021 21:26:56 -0000 It never makes sense for a GOMP_MAP_ATTACH_DETACH mapping to survive beyond gimplify.c, and with OpenMP making use of that mapping type too now alongside OpenACC, there are cases where it was making it through to omp-low.c. This patch rewrites such mappings to GOMP_MAP_ATTACH or GOMP_MAP_DETACH unconditionally for both OpenACC and OpenMP, in cases where it hasn't otherwise been handled already in the preceding code. OK for trunk? Thanks, Julian 2021-05-14 Julian Brown gcc/ * gimplify.c (gimplify_scan_omp_clauses): Remove OpenACC-only condition for changing GOMP_MAP_ATTACH_DETACH to GOMP_MAP_ATTACH or GOMP_MAP_DETACH. Use detach for OMP_TARGET_EXIT_DATA also. --- gcc/gimplify.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 599063bcd5f..69ab637367c 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -9648,16 +9648,11 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p, if (cont) continue; } - else if ((code == OACC_ENTER_DATA - || code == OACC_EXIT_DATA - || code == OACC_DATA - || code == OACC_PARALLEL - || code == OACC_KERNELS - || code == OACC_SERIAL) - && OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_ATTACH_DETACH) + else if (OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_ATTACH_DETACH) { - gomp_map_kind k = (code == OACC_EXIT_DATA - ? GOMP_MAP_DETACH : GOMP_MAP_ATTACH); + gomp_map_kind k + = ((code == OACC_EXIT_DATA || code == OMP_TARGET_EXIT_DATA) + ? GOMP_MAP_DETACH : GOMP_MAP_ATTACH); OMP_CLAUSE_SET_MAP_KIND (c, k); } -- 2.29.2