From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CBCBB3853545; Sat, 9 Mar 2024 07:13:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CBCBB3853545 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709968437; bh=xvFsyR/RkBrTNqjGBVBVRJild4jmAZsMaHHK8NxMT3o=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DnDgG41s2WGbKiLd3207zEmPp1b7Z1wtC/Ibv7xpkQGlcjB4OTL6oXyCWOdOybMIq yZrmrgHC/RS2WpDizRpAh7PH8fC6AsWfqxC4GRrC014KO1xJu428vhq7KXkHGe2EyK +wa3ee4OU0Nb/HdG8rYcuwpbodVs4fSedEdaT5b8= From: "law at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110538] [14 Regression] Dead Code Elimination Regression since r14-368-ge1366a7e4ce Date: Sat, 09 Mar 2024 07:13:56 +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: law at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110538 --- Comment #3 from Jeffrey A. Law --- Thread references removed edge: Cancelling jump thread: (9, 10) incoming edge; (10, 8) joiner (8, 6) normal; Thread references removed edge: Cancelling jump thread: (2, 3) incoming e= dge; (3, 9) joiner (9, 10) nocopy (10, 8) normal; Thread references removed edge: Cancelling jump thread: (2, 3) incoming e= dge; (3, 10) joiner (10, 8) normal; Thread references removed edge: Cancelling jump thread: (3, 10) incoming edge; (10, 8) normal; [ ... ] Merging blocks 10 and 8 Removing basic block 11 ;; basic block 11, loop depth 1 ;; pred:=20=20=20=20=20=20=20=20=20 goto ; [100.00%] ;; succ: 3 So one of the edges in the jump threading path gets removed. As a result t= he threader throws the path away. At least that's my best guess. We could possibly defer block merging until after threading. No idea how h= ard that might be. The sequencing is a bit painful, but IIRC the key is that we must remove unreachables in the CFG before threading (due to how unreachabl= es interact with the dominator tree updates).=