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

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
here is one that is more correct to show the failure:
```
unsigned __GIMPLE (ssa,startwith("phiopt"))
foo (unsigned a, unsigned b)
{
  unsigned j;
  unsigned _23;
  unsigned _12;

  __BB(2):
  if (a_6(D) > 0u)
    goto __BB3;
  else
    goto __BB4;

  __BB(3):
  j_10 = __PHI (__BB2: b_7(D));
  _23 = __MIN (a_6(D), j_10);
  goto __BB4;

  __BB(4):
  _12 = __PHI (__BB3: _23, __BB2: 0u);
  return _12;
}
```

But note this does use the canonical form for the comparison; `a > 0u` is the
non-canonical form of `a != 0u` (for unsigned types). That is why it didn't
show up before. My patch (r14-3827-g30e6ee074588ba ) fixed the issue with the
way comparison was doing and exposed this latent bug. It was trying `j_10 >=
1u` before when it should have been doing `j_10 >= 0u` and that is the issue.

THIS only shows up with unsigned types because  `j_10 >= 0u` is always true and
it needed that to match the constant really.

Anyways my patch fixes the issue

Reply via email to