From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1968C3858003; Tue, 16 Nov 2021 10:32:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1968C3858003 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102880] [12 Regression] Dead Code Elimination Regression at -O3 Date: Tue, 16 Nov 2021 10:32:15 +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: 12.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: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 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: Tue, 16 Nov 2021 10:32:16 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102880 --- Comment #8 from CVS Commits --- The master branch has been updated by Richard Biener : https://gcc.gnu.org/g:045206450386bcd774db3bde0c696828402361c6 commit r12-5301-g045206450386bcd774db3bde0c696828402361c6 Author: Richard Biener Date: Fri Nov 12 10:21:22 2021 +0100 tree-optimization/102880 - improve CD-DCE The PR shows a missed control-dependent DCE caused by CFG cleanup merging a forwarder resulting in a partially degenerate PHI node. With control-dependent DCE we need to mark control dependences of incoming edges into PHIs as necessary but that is unnecessarily conservative for the case when two edges have the same value. There is no easy way to mark only a subset of control dependences of both edges necessary so the fix is to produce forwarder blocks where then the control dependence captures the requirements more precisely. For gcc.dg/tree-ssa/ssa-dom-thread-7.c the number of edges in the CFG decrease as we have commonized PHI arguments which in turn results in different threadings. The testcase is too complex and the dump scanning too simple to do anything meaningful here but to adjust the number of expected threads. The same CFG massaging could be useful at RTL expansion time to reduce the number of copies we need to insert on edges. FAIL: gcc.dg/tree-ssa/ssa-hoist-4.c scan-tree-dump-times optimized "MAX_EXPR" 1 2021-11-12 Richard Biener PR tree-optimization/102880 * tree-ssa-dce.c (sort_phi_args): New function. (make_forwarders_with_degenerate_phis): Likewise. (perform_tree_ssa_dce): Call make_forwarders_with_degenerate_phis. * gcc.dg/tree-ssa/pr102880.c: New testcase. * gcc.dg/tree-ssa/pr69270-3.c: Robustify. * gcc.dg/tree-ssa/ssa-dom-thread-7.c: Change the number of expected threadings.=