From: Andrew Pinski Date: Sun, 28 Dec 2025 20:50:12 +0000 (-0800) Subject: ifcvt: Allow non-comparisons against 0 in noce_try_cond_zero_arith X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc515677b95d292d619c1fe6748a0d91385ca3ff;p=thirdparty%2Fgcc.git ifcvt: Allow non-comparisons against 0 in noce_try_cond_zero_arith Like r16-6332-g2a84a753afcf37 but instead of just allowing any comparisons against 0, this allows all comparisons. I mentioned this in https://gcc.gnu.org/pipermail/gcc-patches/2025-December/704463.html. gcc/ChangeLog: * ifcvt.cc (noce_try_cond_zero_arith): Remove restriction on comparison against 0. Signed-off-by: Andrew Pinski --- diff --git a/gcc/ifcvt.cc b/gcc/ifcvt.cc index 2b8f68a9b41..49e09f3d384 100644 --- a/gcc/ifcvt.cc +++ b/gcc/ifcvt.cc @@ -3157,9 +3157,6 @@ noce_try_cond_zero_arith (struct noce_if_info *if_info) if (!noce_simple_bbs (if_info)) return false; - if (!REG_P (XEXP (cond, 0)) || !rtx_equal_p (XEXP (cond, 1), const0_rtx)) - return false; - a = copy_rtx (if_info->a); b = copy_rtx (if_info->b);