From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 25BDF385841A; Wed, 7 Sep 2022 11:28:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 25BDF385841A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662550117; bh=asTEXyuiurl2/mu+72cKsFtozTF2I5LCJb4+gIVl/zA=; h=From:To:Subject:Date:From; b=ofj6GetOwzeq7ybhwV0xjchcgEB8rLteUqlWkOTNB0P5aWq8tw13gDpluer01x8M+ pYfotDB5cpFPh7MMZ/Bngc9ALemj5NzTWTr1xCpffutZ+ttTU0OX+qjYJ/n9HaB8dd CeLhX8XWOjOFFLaq+GuGBu/8PwkB73PZX+t0BUEk= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/106870] New: ctrl_altering flag is not set correctly Date: Wed, 07 Sep 2022 11:28:36 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D106870 Bug ID: 106870 Summary: ctrl_altering flag is not set correctly Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org Target Milestone: --- When trying to add the following verification I run into various issues with the gimple_ctrl_altering_p flag which stmt_ends_bb_p which sets found_ctrl_= stmt ultimatively relies on for the noreturn case. diff --git a/gcc/tree-cfg.cc b/gcc/tree-cfg.cc index bbe08357d6e..a939a11d8bb 100644 --- a/gcc/tree-cfg.cc +++ b/gcc/tree-cfg.cc @@ -5708,6 +5709,14 @@ gimple_verify_flow_info (void) seen_nondebug_stmt =3D true; } + if (!found_ctrl_stmt && EDGE_COUNT (bb->succs) !=3D 1) + { + error ("basic block %d has no control altering stmt but %d " + "outgoing edges", + bb->index, EDGE_COUNT (bb->succs)); + err =3D 1; + } + gsi =3D gsi_last_nondebug_bb (bb); if (gsi_end_p (gsi)) continue;=