From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 958173972038; Wed, 27 May 2020 18:30:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 958173972038 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1590604218; bh=/bCY5u2OMRTMNoU9j87lFMSkftsVu+MzBsdra1nQXSQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=tzUVI1OEFE/tDwDNgrF1CyvJZWSF280ouuaBaIC5DHXy5NRSBPlja003Jeq/SBbot zcKu2VAsEGL3UubbkLUBmIlM2Yu/+FEGMTKiff/yrSpiKI92rRvI2C+i3VyuS1dRG7 VgYMEmyBpaxhLm04VngriUN9WbvyrA1r1xjSepa0= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug jit/95314] Sharing a local reference to a global variable in multiple functions results in location references block not in block tree Date: Wed, 27 May 2020 18:30:18 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: jit X-Bugzilla-Version: 10.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dmalcolm at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2020 18:30:18 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95314 --- Comment #11 from CVS Commits --- The master branch has been updated by David Malcolm : https://gcc.gnu.org/g:c98bd673ef93836f03491201f1c63929ea429cd6 commit r11-668-gc98bd673ef93836f03491201f1c63929ea429cd6 Author: David Malcolm Date: Wed May 27 09:44:07 2020 -0400 jit: use deep unsharing of trees [PR 95314] PR jit/95314 reports a internal error inside verify_gimple, which turned out to be due to reusing the result of gcc_jit_lvalue_get_address in several functions, leading to tree nodes shared between multiple function bodies. This patch fixes the issue by adopting the "Deep unsharing" strategy described in the comment in gimplify.c preceding mostly_copy_tree_r: to mark all of the jit "frontend"'s expression tree nodes with TREE_VISITED, and to set LANG_HOOKS_DEEP_UNSHARING, so that "they are unshared on the first reference within functions when the regular unsharing algorithm runs". gcc/jit/ChangeLog: PR jit/95314 * dummy-frontend.c (LANG_HOOKS_DEEP_UNSHARING): Define to be tr= ue. * jit-playback.h (gcc::jit::playback::rvalue): Mark tree node w= ith TREE_VISITED. gcc/testsuite/ChangeLog: PR jit/95314 * jit.dg/all-non-failing-tests.h: Add test-pr95314-rvalue-reuse= .c. * jit.dg/test-pr95314-rvalue-reuse.c: New test.=