https://gcc.gnu.org/g:6f16039dfef88ea9e3ed7c2c7667d09f20cd72eb
commit 6f16039dfef88ea9e3ed7c2c7667d09f20cd72eb Author: Michael Meissner <meiss...@linux.ibm.com> Date: Wed May 14 21:02:09 2025 -0400 Don't allow floating point modes to be reversed. 2025-05-14 Michael Meissner <meiss...@linux.ibm.com> * config/rs6000/rs6000.h (REVERSIBLE_CC_MODE): Don't allow FP modes to be reversed on power9 if NaNs are allowed. Diff: --- gcc/config/rs6000/rs6000.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index cf51d904c5e4..d09032b09ace 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -1818,7 +1818,8 @@ extern scalar_int_mode rs6000_pmode; starting with the power9 because ifcvt.cc will want to create a fp cmove, and the x{s,v}cmp{eq,gt,ge}{dp,qp} instructions will trap if one of the arguments is a signalling NaN. */ -#define REVERSIBLE_CC_MODE(MODE) 1 +#define REVERSIBLE_CC_MODE(MODE) \ + (flag_finite_math_only || !TARGET_P9_VECTOR || (MODE) != CCFPmode) /* Given a condition code and a mode, return the inverse condition. */ #define REVERSE_CONDITION(CODE, MODE) \