[gcc(refs/vendors/riscv/heads/gcc-15-with-riscv-opts)] ifcvt: Only allow scalar integral modes for noce_try_cond_zero_arith [PR123276]
Jeff Law
law@gcc.gnu.org
Fri Jan 30 07:14:30 GMT 2026
https://gcc.gnu.org/g:2a3d3bd66ea0740cc3b92d297a1ca0c955a8e521
commit 2a3d3bd66ea0740cc3b92d297a1ca0c955a8e521
Author: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
Date: Tue Dec 23 13:04:28 2025 -0800
ifcvt: Only allow scalar integral modes for noce_try_cond_zero_arith [PR123276]
This is the simple fix for PR 123276 where this code can only handle scalar
integral modes. We could in theory handle scalar floating point modes here
too but it is not worth the trouble.
Pushed as obvious after bootstrap/test on x86_64-linux-gnu.
PR rtl-optimization/123276
gcc/ChangeLog:
* ifcvt.cc (noce_try_cond_zero_arith): Reject non-scalar integral modes.
Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
(cherry picked from commit 2680785a6d14d7d78550edb8361f3b47eb5c4cb6)
Diff:
---
gcc/ifcvt.cc | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/gcc/ifcvt.cc b/gcc/ifcvt.cc
index 2627bf7a8789..e305e3b4c575 100644
--- a/gcc/ifcvt.cc
+++ b/gcc/ifcvt.cc
@@ -3150,6 +3150,13 @@ noce_try_cond_zero_arith (struct noce_if_info *if_info)
machine_mode mode = GET_MODE (if_info->x);
bool reverse = false;
+ /* Scalar integral modes are only supported here.
+ Could support scalar floating point but that
+ would be only with -ffast-math and might
+ be worse than a branch. */
+ if (!SCALAR_INT_MODE_P (mode))
+ return false;
+
if (!noce_simple_bbs (if_info))
return false;
More information about the Gcc-cvs
mailing list