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

--- Comment #12 from Yury Gribov <ygribov at gcc dot gnu.org> ---
Created attachment 41813
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41813&action=edit
Too simple patch for last issue

(In reply to David Binderman from comment #10)
> I have this code:
> ...
> derived from Linux kernel and it does this with revision 250361:

This happens because count for basic block which calls b() is 0 after
early_inline.  This prevents probablity assignment in
combine_predictions_for_bb:
  if (!bb->count.initialized_p () && !dry_run)
    {
      first->probability
         = profile_probability::from_reg_br_prob_base (combined_probability);
      second->probability = first->probability.invert ();
    }

Later this ICEs in estimate_bb_frequencies because it assumes probability is
set:
  if (!bb->count.initialized_p () && !dry_run)
    {
      first->probability
         = profile_probability::from_reg_br_prob_base (combined_probability);
      second->probability = first->probability.invert ();
    }

Here's a simple fix but it looks more like a hack.

Reply via email to