From: Kael Andrew Alonzo Franco Date: Fri, 17 Jul 2026 18:14:26 +0000 (-0400) Subject: match: Move tree_expr_nonnegative_p (@1) to tree_expr_nonnegative_p@1. [PR126087] X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0fb1d14d2a207764d10d4e7911f5f7233d15c998;p=thirdparty%2Fgcc.git match: Move tree_expr_nonnegative_p (@1) to tree_expr_nonnegative_p@1. [PR126087] 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 --- diff --git a/gcc/match.pd b/gcc/match.pd index a5870dae46b..07b3f72d73b 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -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.