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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
here is another one:
```
unsigned
f5 (unsigned  x)
{
  bool t = x >= 1U<<(sizeof(x)*8-1);
  if (!t)
    ;
  else
    x = 1U<<(sizeof(x)*8-1);
  return x;
}
```

this time LLVM does not detect it either.

easy way to see that out is by using riscv and -march=rv32gc_zba_zbb_zbc_zbs.
You should get for all 5 functions:
        li      a5,-2147483648
        minu    a0,a0,a5
        ret

Or:
        lui     a1, 524288
        minu    a0, a0, a1
        ret

Both are execute the same in the end.

Reply via email to