From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1C57B3858D37; Thu, 7 Sep 2023 19:26:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1C57B3858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694114770; bh=Ym2sugTah69lHvODEjuDcknPClLuQV8v1fT1YP4TB18=; h=From:To:Subject:Date:In-Reply-To:References:From; b=v7oW/u5iIRZAjyEQXD2qzaX6DFJ96e4BN5joWGXtuuTsldeXQxP1gMtiGyO0MgiDf ehuVC0H8irZn2aNiyZzubA2bkG9hDQPAtxUr++CNyy9JvhCREctMEpw0F13XMzhabD UgIXvejpBol8iPjz3ounnjzoy4CeGDeKpJO1Rs0k= From: "amacleod at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110875] [14 Regression] Dead Code Elimination Regression since r14-2501-g285c9d042e9 Date: Thu, 07 Sep 2023 19:26:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: amacleod at redhat dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: resolution bug_status 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110875 Andrew Macleod changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #4 from Andrew Macleod --- When range_of_stmt invokes prefill_name to evaluate unvisited dependencies = it should not mark visited names as always_current. when ranger_cache::get_globaL_range() is invoked with the optional "curren= t_p" flag, it triggers additional functionality. This call is meant to be from within ranger and it is understood that if the current value is not current= ,=20 set_global_range will always be called later with a value. Thus it sets the always_current flag in the temporal cache to avoid computation cycles. the prefill_stmt_dependencies () mechanism within ranger is intended to emu= late the bahaviour of range_of_stmt on an arbitrarily long series of unresolved dependencies without triggering the overhead of huge call chains from the range_of_expr/range_on_entry/range_on_exit routines. Rather, it creates a stack of unvisited names, and invokes range_of_stmt on them directly in ord= er to get initial cache values for each ssa-name. The issue in this PR was that routine was incorrectly invoking the get_global_cache to determine whether there was a global value. If there w= as, it would move on to the next dependency without invoking set_global_range to clear the always_current flag. What it should have been doing was simply checking if there as a global val= ue, and if there was not, add the name for processing and THEN invoke get_global_value to do all the special processing. fixed.=