From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5AE093858C3A; Wed, 22 Dec 2021 01:59:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5AE093858C3A From: "luoxhu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/103793] [12 Regression] ICE: in to_reg_br_prob_base, at profile-count.h:277 with -O3 -fno-guess-branch-probability since r12-6086-gcd5ae148c47c6dee Date: Wed, 22 Dec 2021 01:59:03 +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 X-Bugzilla-Severity: normal X-Bugzilla-Who: luoxhu at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: luoxhu at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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 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: Wed, 22 Dec 2021 01:59:03 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103793 luoxhu at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |luoxhu at gcc dot g= nu.org --- Comment #2 from luoxhu at gcc dot gnu.org --- Confirmed. -fno-guess-branch-probability requires the profile_count be initialized, so add guard like this? + if (true_edge->probability.initialized_p ()) + { + edge exit_to_latch1 =3D single_pred_edge (loop1->latch); + exit_to_latch1->probability + =3D exit_to_latch1->probability.apply_scale ( + true_edge->probability.to_reg_br_prob_base (), + REG_BR_PROB_BASE); + single_exit (loop1)->probability + =3D exit_to_latch1->probability.invert (); + }=