From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6A2C93858C50; Mon, 10 Jun 2024 09:26:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A2C93858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1718011564; bh=RYw36srhKo05XSBWz4zc6uBggMDc/+Npob0FLe6a5uI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nQDV0Tp07FrlLyoH5ByfLrlvsWKS2aWtsLmPyN96qbs8Cxv6bipwm1kW8iYBlTgGb 6bYVsSQuYmfpvTTi05IeyBIi/gwQO6nbiFLD4km92a/ka4zvRmVJU+uRXG4L9SX6Mz X1C7+gRji715H+PIRVOMvyss7idCNV/a0+lQhWGU= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/115388] [15 Regression] wrong code at -O3 on x86_64-linux-gnu since r15-571-g1e0ae1f52741f7 Date: Mon, 10 Jun 2024 09:26:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 15.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: 15.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=3D115388 --- Comment #4 from Richard Biener --- It's DSE5 deleting Deleted dead store: a[b.19_216] =3D 1; there's a big irreducible region following the loop with this store, but I fail to see how we can reach the load without going through the other redundant store. Ah, wait - it's the same as with loops in irreducible regions and triggering a latent issue. We do /* If we visit this PHI by following a backedge then = we have to make sure ref->ref only refers to SSA names that are invariant with respect to the loop represented by this PHI node. */ if (dominated_by_p (CDI_DOMINATORS, gimple_bb (stmt), gimple_bb (use_stmt)) && !for_each_index (ref->ref ? &ref->ref : &ref->base, check_name, gimple_bb (use_stmt))) return DSE_STORE_LIVE; but we identify backedges by using dominators which only works for natural loops and not irreducible regions. We have to either disregard all refs in irreducible regions or check for invariantness in the irreducible (sub-)reg= ion spanned by the PHI and the backedge source. I'm going to check the latter.=