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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
It's a combination of sign-changed compare and  X - Y CMP 0 to X CMP Y.  Bad
is

  <bb 4>:
  _9 = end_8 - start_6;
  length_10 = (size_t) _9;
  if (start_6 == end_8)

and I guess good was

  if (length_10 == 0)

where the sign-change actually didn't matter.  The single-use restriction
on the X - Y CMP 0 to X CMP Y doesn't help us because it has just a single
use - the conversion.  The sign-change and widen comparison optimization
has no such restriction though.  Adding that restriction avoids the above
transform and fixes the testcase.

Reply via email to