Hi, sending a v3 of https://gcc.gnu.org/pipermail/gcc-patches/2024-August/661066.html with the following changes since v2:
- Split one big patch into 4 smaller ones, each corresponding to a specific new match.pd (sub-)pattern. - Clarified the logic of each transformation in inline comments as well as in commit messages. - Simplified new testcases by removing unnecessary type limit constants ({U,}INT32_{MIN,MAX}). - Removed use of fold_overflow_warning () in patch #1. - Fixed an implementation error in patch #3 (use bit_not (C2) instead of negate (C2)). - Fixed an implementation error in patch #4 (switch sign of INF in computation of c1_cst and use c2 instead of max/min). - Multiple smaller cosmetic improvements. Could someone please help out with review and/or pushing this to trunk/14? Many thanks in advance, Artemiy Artemiy Volkov (4): tree-optimization/116024 - simplify C1-X cmp C2 for UB-on-overflow types tree-optimization/116024 - simplify C1-X cmp C2 for unsigned types tree-optimization/116024 - simplify C1-X cmp C2 for wrapping signed types tree-optimization/116024 - simplify some cases of X +- C1 cmp C2 gcc/match.pd | 109 +++++++++++++++++- gcc/testsuite/gcc.dg/pr67089-6.c | 4 +- .../gcc.dg/tree-ssa/pr116024-1-fwrapv.c | 73 ++++++++++++ gcc/testsuite/gcc.dg/tree-ssa/pr116024-1.c | 73 ++++++++++++ .../gcc.dg/tree-ssa/pr116024-2-fwrapv.c | 38 ++++++ gcc/testsuite/gcc.dg/tree-ssa/pr116024-2.c | 38 ++++++ gcc/testsuite/gcc.dg/tree-ssa/pr116024.c | 74 ++++++++++++ .../gcc.target/aarch64/gtu_to_ltu_cmp_1.c | 2 +- 8 files changed, 407 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr116024-1-fwrapv.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr116024-1.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr116024-2-fwrapv.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr116024-2.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr116024.c -- 2.44.2