From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id 41E163858C53; Wed, 4 May 2022 16:38:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 41E163858C53 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,198,1647331200"; d="scan'208";a="75361325" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 04 May 2022 08:38:37 -0800 IronPort-SDR: niFglbpRA56bCFeJY5bZT9mwyilMWa0fy1sLGP8D78eSxMhmuJPFk8urqS8YeFCvJhQeZteZMF abJecBD3q/cjqm9RSiXx0NwHju9AaoB+GscXT0GuWUocAMbvNMVgWIdDC/bzCGu58nitjRl1SX czs9RT55lOxn9dmyHV9FbcNh6qoNAhcZoUSq2ftQMfx/fv+GPeuU9nO29e57UlhW6ThhFOWjtN vcDXtvGN9QL1lEZlfPEVxf55vPMAF3DgKXQIjOQn78FSPgO2lRCJZ7mA/xckw53badNUmFW94M /x0= Message-ID: <6b8ee54d-efd0-e1c6-98e1-72c47f7deab9@codesourcery.com> Date: Wed, 4 May 2022 18:38:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [Patch] OpenMP: Fix use_device_{addr,ptr} with in-data-sharing arg Content-Language: en-US To: Jakub Jelinek , Tobias Burnus CC: gcc-patches , fortran References: From: Tobias Burnus In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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, 04 May 2022 16:38:39 -0000 Hi Jakub, On 04.05.22 14:03, Jakub Jelinek wrote: > On Wed, Apr 20, 2022 at 03:19:38PM +0200, Tobias Burnus wrote: >> --- a/gcc/omp-low.cc >> +++ b/gcc/omp-low.cc >> @@ -13656,26 +13656,30 @@ lower_omp_target (gimple_stmt_iterator *gsi_p,= omp_context *ctx) >> new_var =3D lookup_decl (var, ctx); >> new_var =3D DECL_VALUE_EXPR (new_var); >> tree v =3D new_var; >> + tree v2 =3D var; >> + if (OMP_CLAUSE_CODE (c) =3D=3D OMP_CLAUSE_USE_DEVICE_PTR >> + || OMP_CLAUSE_CODE (c) =3D=3D OMP_CLAUSE_USE_DEVICE_ADD= R) >> + { >> + v2 =3D maybe_lookup_decl_in_outer_ctx (var, ctx); >> + if (DECL_HAS_VALUE_EXPR_P (v2)) >> + v2 =3D DECL_VALUE_EXPR (v2); > I don't understand the above 2 lines, why do you need that? I think it was intermittently required with some (half-)working patch. But I concur that it is no longer is needed. > Otherwise LGTM, so if the 2 lines aren't needed, please also drop the > {}s around v2 =3D maybe_lookup_decl_in_outer_ctx (var, ctx); and reindent= . I did so, tested it also on my end and committed it as r13-116-g3f8c389fe90bf565a6221a46bb7fb745dd4c1510 Thanks for the review! Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955