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 A195C3861928; Tue, 30 Jun 2020 15:59:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A195C3861928 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Thomas_Schwinge@mentor.com IronPort-SDR: Q4fU83Z1vhc0tkSLE0GkyMhNlLN50zpCn+iFaG+GTZK8+EYM+2DFYMlMJ2QQdnx0rnX9likrvT irojb907NzZ2z5AtPBjEYRb0th/LoMuy+S1EW2UxbhqSUokJo3nZtCtiiLJez2dKqo83Dk5khM dmiIl6EHHpbNFiB+Gnf6Xka0AIYh2mpVGK8V8/Gj33Tv830WVNHofyAniqcsyJaHqYRYGZF6lt rI73N7qnqeMBNlXfu0QM41iTS829GB25WEDsy46t5/IuRkhFj9CUxVr0pi+d3MWQJZNuiPz+jp l8c= X-IronPort-AV: E=Sophos;i="5.75,297,1589270400"; d="scan'208,223";a="50448838" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 30 Jun 2020 07:59:13 -0800 IronPort-SDR: VnySTPaZqmxH6pyYVmNXKJ2tTw9MIQOKngoo0h/PxTIUM2fSvC6E6NUrEIF/8W+LqQdjH3/QmZ JO/mIA/7DiH0ADbCERJtCQJXdpw1GVYsXT5dHZ7nTFGcVrahDU88UAbGeLTSYRfGnfnn36J9Wr 7o6Pjq1xUUYSJde3/wIsHbm5Vg3+nWWQ0ELivlWY1+jr82p/DtJJVA3SmLVly09V6Q0QKEX1j8 cPHW29oPh0PQFsGorUYGhRoBC6cpoXbkbAqAvWdsx0sxUZQSyi6CKRcljzT2LA6trO1cIg5fnU 0+s= From: Thomas Schwinge To: Julian Brown , CC: Jakub Jelinek , Tobias Burnus , , Subject: Re: [PATCH 07/13] OpenACC 2.6 deep copy: libgomp parts In-Reply-To: <65540b92dff74db1f15af930f87f7096d03e7efe.1576648001.git.julian@codesourcery.com> References: <65540b92dff74db1f15af930f87f7096d03e7efe.1576648001.git.julian@codesourcery.com> User-Agent: Notmuch/0.29.1+93~g67ed7df (https://notmuchmail.org) Emacs/26.3 (x86_64-pc-linux-gnu) Date: Tue, 30 Jun 2020 17:58:52 +0200 Message-ID: <87h7uszgsj.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_LOTSOFHASH, 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: Tue, 30 Jun 2020 15:59:16 -0000 --=-=-= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Julian! On 2019-12-17T22:03:47-0800, Julian Brown wrote: > This part contains the libgomp runtime support for the GOMP_MAP_ATTACH an= d > GOMP_MAP_DETACH mapping kinds (etc.), as introduced by the front-end > patches following in this series. > --- a/libgomp/target.c > +++ b/libgomp/target.c > @@ -540,6 +540,7 @@ gomp_map_vars_existing (struct gomp_device_descr *dev= icep, > tgt_var->key =3D oldn; > tgt_var->copy_from =3D GOMP_MAP_COPY_FROM_P (kind); > tgt_var->always_copy_from =3D GOMP_MAP_ALWAYS_FROM_P (kind); > + tgt_var->do_detach =3D kind =3D=3D GOMP_MAP_ATTACH; > tgt_var->offset =3D newn->host_start - oldn->host_start; > tgt_var->length =3D newn->host_end - newn->host_start; > For 'kind =3D=3D GOMP_MAP_ATTACH', this function 'gomp_map_vars_existing' i= s actually unreachable. > @@ -978,8 +979,15 @@ gomp_map_vars_internal (struct gomp_device_descr *de= vicep, > has_firstprivate =3D true; > continue; > } > + else if ((kind & typemask) =3D=3D GOMP_MAP_ATTACH) > + { > + tgt->list[i].key =3D NULL; > + has_firstprivate =3D true; > + continue; > + } Given this, the following condition also is always-false: > cur_node.host_start =3D (uintptr_t) hostaddrs[i]; > - if (!GOMP_MAP_POINTER_P (kind & typemask)) > + if (!GOMP_MAP_POINTER_P (kind & typemask) > + && (kind & typemask) !=3D GOMP_MAP_ATTACH) > cur_node.host_end =3D cur_node.host_start + sizes[i]; > else > cur_node.host_end =3D cur_node.host_start + sizeof (void *); Thus pushed "Mark up unreachable OpenACC 'attach' code path" to master branch in commit aff43ac0aed5185884724adbdfd4dbbabd87637c, and releases/gcc-10 branch in commit 4b185ee144d0c53ea7f08d4edaa8b578739498be, see attached. Gr=C3=BC=C3=9Fe Thomas ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstra=C3=9Fe 201, 80634 M=C3=BCnch= en / Germany Registergericht M=C3=BCnchen HRB 106955, Gesch=C3=A4ftsf=C3=BChrer: Thomas = Heurung, Alexander Walter --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename="0001-Mark-up-unreachable-OpenACC-attach-code-path.patch" >From aff43ac0aed5185884724adbdfd4dbbabd87637c Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 26 Jun 2020 10:19:14 +0200 Subject: [PATCH] Mark up unreachable OpenACC 'attach' code path ... introduced in commit 8e7e71ff247fb116dc381c5ef0c09acc0d2b374f (r279625) "OpenACC 2.6 deep copy: libgomp parts". libgomp/ * target.c (gomp_map_vars_existing): Assert 'kind != GOMP_MAP_ATTACH'. (gomp_map_vars_internal): Clean up. --- libgomp/target.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libgomp/target.c b/libgomp/target.c index 36425477dcb0..d4a4a408b400 100644 --- a/libgomp/target.c +++ b/libgomp/target.c @@ -357,10 +357,12 @@ gomp_map_vars_existing (struct gomp_device_descr *devicep, splay_tree_key newn, struct target_var_desc *tgt_var, unsigned char kind, struct gomp_coalesce_buf *cbuf) { + assert (kind != GOMP_MAP_ATTACH); + tgt_var->key = oldn; tgt_var->copy_from = GOMP_MAP_COPY_FROM_P (kind); tgt_var->always_copy_from = GOMP_MAP_ALWAYS_FROM_P (kind); - tgt_var->do_detach = kind == GOMP_MAP_ATTACH; + tgt_var->do_detach = false; tgt_var->offset = newn->host_start - oldn->host_start; tgt_var->length = newn->host_end - newn->host_start; @@ -815,8 +817,7 @@ gomp_map_vars_internal (struct gomp_device_descr *devicep, continue; } cur_node.host_start = (uintptr_t) hostaddrs[i]; - if (!GOMP_MAP_POINTER_P (kind & typemask) - && (kind & typemask) != GOMP_MAP_ATTACH) + if (!GOMP_MAP_POINTER_P (kind & typemask)) cur_node.host_end = cur_node.host_start + sizes[i]; else cur_node.host_end = cur_node.host_start + sizeof (void *); -- 2.27.0 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename="0001-Mark-up-unreachable-OpenACC-attach-code-path.g10.patch" >From 4b185ee144d0c53ea7f08d4edaa8b578739498be Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 26 Jun 2020 10:19:14 +0200 Subject: [PATCH] Mark up unreachable OpenACC 'attach' code path ... introduced in commit 8e7e71ff247fb116dc381c5ef0c09acc0d2b374f (r279625) "OpenACC 2.6 deep copy: libgomp parts". libgomp/ * target.c (gomp_map_vars_existing): Assert 'kind != GOMP_MAP_ATTACH'. (gomp_map_vars_internal): Clean up. (cherry picked from commit aff43ac0aed5185884724adbdfd4dbbabd87637c) --- libgomp/target.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libgomp/target.c b/libgomp/target.c index 36425477dcb0..d4a4a408b400 100644 --- a/libgomp/target.c +++ b/libgomp/target.c @@ -357,10 +357,12 @@ gomp_map_vars_existing (struct gomp_device_descr *devicep, splay_tree_key newn, struct target_var_desc *tgt_var, unsigned char kind, struct gomp_coalesce_buf *cbuf) { + assert (kind != GOMP_MAP_ATTACH); + tgt_var->key = oldn; tgt_var->copy_from = GOMP_MAP_COPY_FROM_P (kind); tgt_var->always_copy_from = GOMP_MAP_ALWAYS_FROM_P (kind); - tgt_var->do_detach = kind == GOMP_MAP_ATTACH; + tgt_var->do_detach = false; tgt_var->offset = newn->host_start - oldn->host_start; tgt_var->length = newn->host_end - newn->host_start; @@ -815,8 +817,7 @@ gomp_map_vars_internal (struct gomp_device_descr *devicep, continue; } cur_node.host_start = (uintptr_t) hostaddrs[i]; - if (!GOMP_MAP_POINTER_P (kind & typemask) - && (kind & typemask) != GOMP_MAP_ATTACH) + if (!GOMP_MAP_POINTER_P (kind & typemask)) cur_node.host_end = cur_node.host_start + sizes[i]; else cur_node.host_end = cur_node.host_start + sizeof (void *); -- 2.27.0 --=-=-=--