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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|ipa                         |gcov-profile

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
So we get optimize_edge_for_size_p () returning OPTIMIZE_SIZE_BALANCED and
thus optimize_edge_for_speed_p which is

340     bool
341     optimize_edge_for_speed_p (edge e)
342     {
343       return !optimize_edge_for_size_p (e);
344     }

return false.  And that's likely because this is 'main'.  At -O2 BB counts
are broken:

  <bb 2> [local count: 1073741824]:
  c = 0;
  b.1_7 = b;
  if (b.1_7 != 0)
    goto <bb 3>; [34.00%]
  else
    goto <bb 7>; [66.00%]

  <bb 7> [local count: 708669600]:
  goto <bb 4>; [100.00%]

  <bb 3> [local count: 3318838410]:
  c = 1;

  <bb 4> [local count: 1073741824]:
  d = 1;

here 3->4 artificially appears 'hot'.  The bogus counts appear during IPA
inlining of g() into main.

Reply via email to