[Bug tree-optimization/96702] Failure to optimize comparisons involving result of subtraction

2023-09-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96702 --- Comment #5 from Andrew Pinski --- (In reply to Andrew Pinski from comment #4) > The pattern: > /* X - Y < X is the same as Y > 0 when there is no overflow. >For equality, this is also true with wrapping overflow. */ > (for op

[Bug tree-optimization/96702] Failure to optimize comparisons involving result of subtraction

2023-09-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96702 --- Comment #4 from Andrew Pinski --- The pattern: /* X - Y < X is the same as Y > 0 when there is no overflow. For equality, this is also true with wrapping overflow. */ (for op (simple_comparison) (simplify (op:c @0 (minus@2 @0 @1))

[Bug tree-optimization/96702] Failure to optimize comparisons involving result of subtraction

2023-09-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96702 --- Comment #3 from Andrew Pinski --- wait that is for unsigned types and we don't have an unsigned type here ..

[Bug tree-optimization/96702] Failure to optimize comparisons involving result of subtraction

2023-09-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96702 --- Comment #2 from Andrew Pinski --- The comment says: /* To detect overflow in unsigned A - B, A < B is simpler than A - B > A. However, the detection logic for SUB_OVERFLOW in tree-ssa-math-opts.cc expects the long form, so we restrict

[Bug tree-optimization/96702] Failure to optimize comparisons involving result of subtraction

2021-08-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96702 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug tree-optimization/96702] Failure to optimize comparisons involving result of subtraction

2021-04-25 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96702 Andrew Pinski changed: What|Removed |Added Severity|normal |enhancement