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

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org

--- Comment #9 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
In this testcase:

void rs6000_emit_move (int mode, int t, int tt)
{
  if (t == 1)
    if (mode != 2)
      t = tttt();
  if (t == 1)
    if (mode != 2)
        __builtin_abort ();
}

The profile update can not go right.  

At the branch prediction time, the first two conditionals are predicted with
some probability close to 50% since the branch predictor can not derive much
about them.

However the last conditional is predicted with very small probability since it
calls 0.  Then the call to tttt() gets higher frequency than call to
__builtin_abort.

Later we discover by jump threading that builtin_abort happens iff the call of
tttt(), so the profile was inconsistent from start, just not in obvious way.
update_bb_profile_for_threading should print out reason into dump file.

Reply via email to