From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ACAC1385841E; Fri, 17 Sep 2021 07:29:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ACAC1385841E From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102385] [12 Regression] ICE: in single_pred_edge, at basic-block.h:350 under "-O2 -fno-toplevel-reorder -fno-tree-ch -fno-tree-dce -fno-tree-dominator-opts -fno-tree-dse -fno-tree-loop-ivcanon -fpredictive-commoning" Date: Fri, 17 Sep 2021 07:29:46 +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: ice-on-valid-code, needs-bisection, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: everconfirmed bug_status cc short_desc keywords cf_reconfirmed_on target_milestone 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: Fri, 17 Sep 2021 07:29:46 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102385 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW CC| |rguenth at gcc dot gnu.org, | |rsandifo at gcc dot gnu.org Summary|ICE: in single_pred_edge, |[12 Regression] ICE: in |at basic-block.h:350 under |single_pred_edge, at |"-O2 -fno-toplevel-reorder |basic-block.h:350 under |-fno-tree-ch -fno-tree-dce |"-O2 -fno-toplevel-reorder |-fno-tree-dominator-opts |-fno-tree-ch -fno-tree-dce |-fno-tree-dse |-fno-tree-dominator-opts |-fno-tree-loop-ivcanon |-fno-tree-dse |-fpredictive-commoning" |-fno-tree-loop-ivcanon | |-fpredictive-commoning" Keywords| |ice-on-valid-code, | |needs-bisection, wrong-code Last reconfirmed| |2021-09-17 Target Milestone|--- |12.0 --- Comment #1 from Richard Biener --- Huh, the code is odd: basic_block exit_bb =3D single_pred (loop->latch); new_exit =3D find_edge (exit_bb, rest); new_exit->probability =3D profile_probability::always () .apply_scale (1, new_est_niter + 1); but here we have a diamond after the block that exits the loop and thus neither a single predecessor of the latch nor would that be something resembling an exit block. It looks like the code might have wanted to use single_pred (rest) here plus eventually splitting the exit edge in case it didn't have a single predecessor. Richard, you refactored this, so likely caused this.=