From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 118369 invoked by alias); 17 Sep 2019 17:22:16 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 118322 invoked by uid 89); 17 Sep 2019 17:22:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: esa4.mentor.iphmx.com Received: from esa4.mentor.iphmx.com (HELO esa4.mentor.iphmx.com) (68.232.137.252) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 17 Sep 2019 17:22:14 +0000 IronPort-SDR: 9HBM64Mg0h+vFPRhz9dqUa7SX6hkBPQFc1GvqBz8r6SGiTGac9IL/Txw1nbkvyV6LbDhuEqybu rGSv2kCQC9bUdRRVH+drv/ZoSaOCl1SyKavTqxQ+e+wYtuBXXDWK+nUdngAnI3Qpg73Rt5RTyH JpRvCV/LT9glLcPE38xx+hBF8Kiw1SGJfohXQ0hPIY+Od4zoCctX8xfGwhUoWzw0OpqzGmWWG5 KeYIWj9EBTz19/e4yym5ONDe0eXF10Lh3fP3xxNs1tJmdz5/i6vj9Opo09uKc6XGykoCmzZ+wx hRQ= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 17 Sep 2019 09:22:14 -0800 IronPort-SDR: O9Sqxl/xFJXESpZe6RHpYZNWa44w8v42UegYUXpFIxVj/ILAVOejdbutIK6NOiWs7caVeJwfII 1US3XWmrXKzQQnQ3Y54QqPyIW/98fz7FRTP7AUPgpgAU4bxFoP5CqNcJZF9lERjyQ7y4rCbn7A 3vrKjNaYpXTHFPv55Bge6YglFggj8qA/GJby5PjTZn25TvuJjXvuKhV1Ce1dr8mRHc3oJxWSPB v0jjASkpgkWjdfBm0dk7DnYoS04kK6rBmSX3OZf9GuRVN/dIsZ5gepX6OSef7UmJQbnBeLc7Ei fs8= From: Julian Brown To: CC: Andrew Stubbs , Thomas Schwinge Subject: [PATCH] [og9] Fix uninitialised read in gomp_map_vars_internal Date: Tue, 17 Sep 2019 17:22:00 -0000 Message-ID: <20190917172156.111727-3-julian@codesourcery.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Return-Path: julian@codesourcery.com X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg01023.txt.bz2 This patch fixes a stray read of uninitialised data in target.c:gomp_map_vars_internal that I noticed when running an unrelated test under valgrind. I will apply to the openacc-gcc-9-branch shortly. Julian ChangeLog libgomp/ * target.c (gomp_map_vars_internal): Remove read of uninitialised data. --- libgomp/ChangeLog.openacc | 5 +++++ libgomp/target.c | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libgomp/ChangeLog.openacc b/libgomp/ChangeLog.openacc index 1a624af1ff9..41e05e9c61b 100644 --- a/libgomp/ChangeLog.openacc +++ b/libgomp/ChangeLog.openacc @@ -1,3 +1,8 @@ +2019-09-17 Julian Brown + + * target.c (gomp_map_vars_internal): Remove read of uninitialised + data. + 2019-09-17 Julian Brown * testsuite/libgomp.oacc-c-c++-common/async_queue-1.c: Only run diff --git a/libgomp/target.c b/libgomp/target.c index 5f7f946e2ba..0656df19613 100644 --- a/libgomp/target.c +++ b/libgomp/target.c @@ -1556,8 +1556,7 @@ gomp_map_vars_internal (struct gomp_device_descr *devicep, kind & typemask, cbufp); else { - if (k->virtual_refcount == VREFCOUNT_LINK_KEY) - k->u.link_key = NULL; + k->u.link_key = NULL; if (n && n->refcount == REFCOUNT_LINK) { /* Replace target address of the pointer with target address -- 2.22.0