From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B1BBE385803E; Fri, 13 May 2022 06:01:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B1BBE385803E From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/105455] ICE: verify_flow_info failed (error: verify_flow_info: REG_BR_PROB does not match cfg) Date: Fri, 13 May 2022 06:01:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: aoliva at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 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, 13 May 2022 06:01:41 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105455 --- Comment #3 from CVS Commits --- The master branch has been updated by Alexandre Oliva : https://gcc.gnu.org/g:90a8eab4a1292430467f68b65e5127f7760acc94 commit r13-380-g90a8eab4a1292430467f68b65e5127f7760acc94 Author: Alexandre Oliva Date: Wed May 11 04:27:42 2022 -0300 [PR105455] Set edge probabilities when hardening conditionals When turning unconditional edges into conditional, as in gimple-harden-conditionals.cc:insert_check_and_trap, the newly-created edge's probability comes out uninitialized, while the previously unconditional edge's probability is presumably profile_probability::always. Mixing initialized and uninitialized probabilities before expand breaks predict.cc:force_edge_cold: the initialized probability may end up copied to a REG_BR_PROB note in a conditional branch insn, but if force_edge_cold is called on that edge, it will find another edge with uninitialized probability and assume the note is absent. Later on, rtl_verify_edges complains that the note does not match the probability modified by force_edge_cold in the edge. This patch sets probabilities for edges affected by hardening of conditionals, both the newly-created edges to trap blocks and the previously-unconditional edges, so that the former are considered never taken, while the latter are confirmed as always taken. for gcc/ChangeLog PR rtl-optimization/105455 * gimple-harden-conditionals.cc (insert_check_and_trap): Set probabilities for newly-conditional edges. for gcc/testsuite/ChangeLog PR rtl-optimization/105455 * gcc.dg/pr105455.c: New.=