]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
match: Move tree_expr_nonnegative_p (@1) to tree_expr_nonnegative_p@1. [PR126087]
authorKael Andrew Alonzo Franco <kaelfandrew@gmail.com>
Fri, 17 Jul 2026 18:14:26 +0000 (14:14 -0400)
committerKael Andrew Alonzo Franco <kaelfandrew@gmail.com>
Fri, 17 Jul 2026 18:14:26 +0000 (14:14 -0400)
This simplify r17-2487.

Bootstrapped and tested on x86_64-pc-linux-gnu.

PR tree-optimization/126087

gcc/ChangeLog:

* match.pd: Move tree_expr_nonnegative_p (@1) to tree_expr_nonnegative_p@1.

Signed-off-by: Kael Andrew Franco <kaelfandrew@gmail.com>
gcc/match.pd

index a5870dae46b98dd341687a671d37f880c7123280..07b3f72d73b34f9c7b83333e7acc57e5f332107c 100644 (file)
@@ -4847,9 +4847,8 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
 (for op (min bit_ior)
   (for cmp (ge lt)
     (simplify
-      (cmp (op:c @0 @1) integer_zerop@2)
-      (if (tree_expr_nonnegative_p (@1))
-        (cmp @0 @2)))))
+      (cmp (op:c @0 tree_expr_nonnegative_p@1) integer_zerop@2)
+        (cmp @0 @2))))
 
 /* Undo fancy ways of writing max/min or other ?: expressions, like
    a - ((a - b) & -(a < b))  and  a - (a - b) * (a < b) into (a < b) ? b : a.