From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id C866338344E4; Wed, 1 Jun 2022 18:39:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C866338344E4 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.91,269,1647331200"; d="scan'208";a="76666086" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 01 Jun 2022 10:39:41 -0800 IronPort-SDR: u5kDAuDQTFTGK5whB7v1HekD2tZsRtupzU71BOFvVkz2uFBOUAgfQ6q70uSDUJheWZbNT6C4M1 TrDfRGjV4HNFcv8yv5OPiC9XtPJujbqjkJrep0YB97AZwaJUgXA3hztCHCnwiLdxmb99GMCNH8 2gB5nWJSEM7SueZwr1XX2z8edhh4fMTDoLCfEQK34f7u278BYFdTG3phGbgEH0hmsG9fKiJ03t 1cf8eZ+JEQdO53T8n+L4M6UOLYZ+AgxluWJn2yOfmrUPoIRlx0Irtvk5fU5Gtr+qn9ee9+/dLB UfA= From: Julian Brown To: CC: , Tobias Burnus , Jakub Jelinek Subject: [PATCH 4/6] OpenMP: Tweak NOP handling in in omp_get_root_term and accumulate_sibling_list Date: Wed, 1 Jun 2022 11:39:22 -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-05.mgc.mentorg.com (139.181.222.5) To svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jun 2022 18:39:43 -0000 This patch strips NOPs in omp_get_root_term and accumulate_sibling_list to cover cases that came up writing tests for "omp declare mapper" functionality. I'll fold this into the originating patch series for those functions during rework. 2022-06-01 Julian Brown gcc/ * gimplify.cc (omp_get_root_term): Look through NOP_EXPRs. (accumulate_sibling_list): Strip NOPs on struct base pointers. --- gcc/gimplify.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc index 1646fdaa9b8..742fd5e4a8d 100644 --- a/gcc/gimplify.cc +++ b/gcc/gimplify.cc @@ -8775,7 +8775,8 @@ omp_get_root_term (tree expr) || (TREE_CODE (expr) == MEM_REF && integer_zerop (TREE_OPERAND (expr, 1))) || TREE_CODE (expr) == POINTER_PLUS_EXPR - || TREE_CODE (expr) == COMPOUND_EXPR) + || TREE_CODE (expr) == COMPOUND_EXPR + || TREE_CODE (expr) == NOP_EXPR) if (TREE_CODE (expr) == COMPOUND_EXPR) expr = TREE_OPERAND (expr, 1); else @@ -9932,6 +9933,8 @@ accumulate_sibling_list (enum omp_region_type region_type, enum tree_code code, sdecl = TREE_OPERAND (sdecl, 0); } + STRIP_NOPS (sdecl); + while (TREE_CODE (sdecl) == POINTER_PLUS_EXPR) sdecl = TREE_OPERAND (sdecl, 0); -- 2.29.2