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

--- Comment #3 from Drea Pinski <pinskia at gcc dot gnu.org> ---
```
  if (c_16 > 0)
    goto <bb 6>; [59.00%]
  else
    goto <bb 5>; [41.00%]

  <bb 5> [local count: 138116127]:
  _38 = c_16 + 1;
  _23 = (short unsigned int) _38;
  _24 = (unsigned int) _23;
  goto <bb 10>; [100.00%]

  <bb 6> [local count: 198752478]:
  _29 = (short unsigned int) c_16;
  _30 = _29 + 1;
  _31 = (unsigned int) _30;
  _33 = (int) c_16;
```
There is a jump threading and then we notice that we can do the addition in
signed char because that won't overflow.  Then hoist comes along and sees that
_23 and _30 are the same (which is true) but uses the leader of _23 and hoists
that; but that introduces a signed overflow which was not there before.

Reply via email to