From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A21AD3858C41; Tue, 5 Mar 2024 11:19:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A21AD3858C41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709637566; bh=aoVLCJ2cxOrvbadMU9Ig/eyjCB5GTeF+Z1zj7xVNA50=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Jxgn62wW0WSXsTe7CaMLBcPNHWEDsKD3Vtddnw3Y94oRoUS2kcNEGugpNNHY04m7B 0Deskx2m9BZwndMXx8q6iOVTCyIprabu4qpWO+8tgkoer+tNCYecuEXpFzjrlLJsmk izMZcXV7G+ROuZPKrmtmxSSEMn6qav7DffYzeYcc= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/112303] [14 Regression] ICE on valid code at -O3 on x86_64-linux-gnu: verify_flow_info failed since r14-3459-g0c78240fd7d519 Date: Tue, 05 Mar 2024 11:19:24 +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: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 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=3D112303 --- Comment #9 from Jakub Jelinek --- Still reproduceable with --- gcc/tree-scalar-evolution.cc +++ gcc/tree-scalar-evolution.cc @@ -3881,7 +3881,7 @@ final_value_replacement_loop (class loop *loop) /* Propagate constants immediately, but leave an unused initializati= on around to avoid invalidating the SCEV cache. */ - if (CONSTANT_CLASS_P (def) && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rslt= )) + if (0 && CONSTANT_CLASS_P (def) && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rslt)) replace_uses_by (rslt, def); /* Create the replacement statements. */ The bb with uninitialized count is created by #7 0x000000000069060b in create_empty_bb (after=3D) at ../../gcc/cfghooks.cc:773 #8 0x0000000000e2c995 in gimple_duplicate_bb (bb=3D, id=3D0x7fffffffc610) at ../../gcc/tree-cfg.cc:6513 #9 0x0000000000691158 in duplicate_block (bb=3D, e=3D, after=3D, id=3D0x7fffffffc610) at ../../gcc/cfghooks.cc:1119 #10 0x00000000006918f5 in copy_bbs (bbs=3D0x3bfa670, n=3D3, new_bbs=3D0x3bc= e9c0, edges=3D0x7fffffffc790, num_edges=3D2, new_edges=3D0x7fffffffc780, base=3D0x7fffe9f1f7d0,=20 after=3D, update_dominance=3Dtrue) at ../../gcc/cfghooks.cc:1384 #11 0x00000000006a19c6 in duplicate_loop_body_to_header_edge (loop=3D0x7fffe9f1f7d0, e=3D 62)>, ndupl=3D2, wont_exit=3D0x3ac78f0,=20 orig=3D 66)>, Python Exception : There is no member or method named m_vecpfx. to_remove=3D0x39ba7b0, flags=3D5) at ../../gcc/cfgloopmanip.cc:1403 #12 0x0000000000fc8fd9 in gimple_duplicate_loop_body_to_header_edge (loop=3D0x7fffe9f1f7d0, e=3D 225)>, ndupl=3D2, wont_exit=3D0x3ac78f0,=20 orig=3D 66)>, Python Exception : There is no member or method named m_vecpfx. to_remove=3D0x39ba7b0, flags=3D5) at ../../gcc/tree-ssa-loop-manip.cc:860 #13 0x0000000000fa53f6 in try_unroll_loop_completely (loop=3D0x7fffe9f1f7d0, exit=3D 66)>, niter=3D, may_be_zero=3Dfalse, ul=3DUL_ALL,=20 maxiter=3D2, locus=3D..., allow_peel=3Dtrue) at ../../gcc/tree-ssa-loop-ivcanon.cc:960 Seems in the above backtrace it is duplicate_block which does the new_bb->c= ount updates. It does: 1107 profile_count new_count =3D e ? e->count (): profile_count::uninitialized (); but e is NULL, so here new_count is unitialized, and then 1114 if (bb->count < new_count) 1115 new_count =3D bb->count; here p bb->count.debug () 2305843009213693950 (estimated locally, freq 144115188075855872.0000) p new_count.debug () uninitialized but bb->count < new_count is false due to bool operator< (const profile_probability &other) const { return initialized_p () && other.initialized_p () && m_val < other.m_= val; } Shouldn't that be if (!(bb->count >=3D new_count)) or if (bb->count < new_c= ount || !new_count.initialized_p ()) ? Honza?=