https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103793

luoxhu at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |luoxhu at gcc dot 
gnu.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 = single_pred_edge (loop1->latch);
+           exit_to_latch1->probability
+             = exit_to_latch1->probability.apply_scale (
+               true_edge->probability.to_reg_br_prob_base (),
+               REG_BR_PROB_BASE);
+           single_exit (loop1)->probability
+             = exit_to_latch1->probability.invert ();
+         }

Reply via email to