[Bug tree-optimization/98909] Failure to optimize odd loop pattern
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98909 --- Comment #3 from Andrew Pinski --- Note this is very similar to PR 112104, in that `~a` can be treated as `a ^ -1`.
[Bug tree-optimization/98909] Failure to optimize odd loop pattern
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98909 Andrew Pinski changed: What|Removed |Added Severity|normal |enhancement
[Bug tree-optimization/98909] Failure to optimize odd loop pattern
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98909 Richard Biener changed: What|Removed |Added Last reconfirmed||2021-02-02 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #2 from Richard Biener --- Confirmed. Final value replacement just uses SCEV.
[Bug tree-optimization/98909] Failure to optimize odd loop pattern
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98909 --- Comment #1 from Gabriel Ravier --- PS: The same pattern with `unsigned` replacing `int` can be optimized to `return x & 1;` (done by LLVM, but not by GCC).