From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 46C493861001; Wed, 24 Apr 2024 04:22:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 46C493861001 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713932546; bh=gOlsj/7PzJgSiZvQ11EFUMQptx/nvnU6WAiEwj1LVoQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OQaBecGPLNhCjNURFuXEcCVsL5GVBVb8WrokXSKOqHTbAXKjosfheIYuWCneZs7AS cLl3xaCD4my+gnUGoP0RcEh/DGqooPtpZBgzrxNnsMsMMRMYGT4QmgOtuWFBFmF6O4 f+k0VzhsYaUPxREgH/UsnS+1eWJei1rWUHIez56I= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114832] [14 Regression] ICE at -O{2,3} with "-fno-tree-loop-if-convert -fno-tree-loop-distribute-patterns -ftree-vectorize" on x86_64-linux-gnu: in verify_dominators, at dominance.cc:1194 Date: Wed, 24 Apr 2024 04:22:26 +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: unknown X-Bugzilla-Keywords: ice-checking, ice-on-valid-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: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status assigned_to 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=3D114832 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot = gnu.org --- Comment #3 from Richard Biener --- With the early break code we now allow multiple blocks in the loop body but guess this only happens for blocks with exits. In this case we have a simp= le forwarder which seems to confuse the code. Usually if-conversion gets rid = of those so -fno-tree-loop-if-convert is critical to trigger this. If we want to fix this on the release branch I think we should reject loops with this kind of CFG again. In stage1 we should fix the real issue. I think the fix is just diff --git a/gcc/tree-vect-loop-manip.cc b/gcc/tree-vect-loop-manip.cc index 8d9b533d50f..43c7881c640 100644 --- a/gcc/tree-vect-loop-manip.cc +++ b/gcc/tree-vect-loop-manip.cc @@ -1523,7 +1523,7 @@ slpeel_tree_duplicate_loop_to_edge_cfg (class loop *l= oop, edge loop_exit, exit_dest =3D exit->dest; was_imm_dom =3D (get_immediate_dominator (CDI_DOMINATORS, - exit_dest) =3D=3D loop->header ? + exit_dest) =3D=3D exit->src ? true : false); /* Also copy the pre-header, this avoids jumping through hoops to=