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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
This is in:
  /* Ensure that the frequencies in the loop match the new estimated
     number of iterations, and change the probability of the new
     exit edge.  */

  freq_h = loop->header->count;
  freq_e = (loop_preheader_edge (loop))->count ();
  if (freq_h.nonzero_p ())
    {
      /* Avoid dropping loop body profile counter to 0 because of zero count
         in loop's preheader.  */
      freq_e = freq_e.force_nonzero ();
      scale_loop_frequencies (loop, freq_e.probability_in (freq_h));
    }
(gdb) p freq_h
$13 = {static n_bits = 61, static max_count = 2305843009213693950, static
uninitialized_count = 2305843009213693951, m_val = 410706248, 
  m_quality = profile_guessed_local}
(gdb) p freq_e
$14 = {static n_bits = 61, static max_count = 2305843009213693950, static
uninitialized_count = 2305843009213693951, m_val = 0, 
  m_quality = profile_precise}
and the problem is calling probability_in with !compatible_p profile_counts -
one is guessed local, i.e. !ipa_p (), the other is precise and thus ipa_p ().

No idea what to do here, don't scale if they aren't incompatible, do something
else?

Reply via email to