@@ -1889,23 +1889,26 @@ simplify_const_unary_operation (enum rtx
case FLOAT_TRUNCATE:
/* Don't perform the operation if flag_signaling_nans is on
and the operand is a signaling NaN. */
- if (!(HONOR_SNANS (mode) && REAL_VALUE_ISSIGNALING_NAN (d)))
- d = real_value_truncate (mode, d);
+ if (HONOR_SNANS (mode) && REAL_VALUE_ISSIGNALING_NAN (d))
+ return NULL_RTX;
+ d = real_value_truncate (mode, d);
break;
case FLOAT_EXTEND:
- /* All this does is change the mode, unless changing
- mode class. */
/* Don't perform the operation if flag_signaling_nans is on
and the operand is a signaling NaN. */
- if (GET_MODE_CLASS (mode) != GET_MODE_CLASS (GET_MODE (op))
- && !(HONOR_SNANS (mode) && REAL_VALUE_ISSIGNALING_NAN (d)))
+ if (HONOR_SNANS (mode) && REAL_VALUE_ISSIGNALING_NAN (d))
+ return NULL_RTX;
+ /* All this does is change the mode, unless changing
+ mode class. */
+ if (GET_MODE_CLASS (mode) != GET_MODE_CLASS (GET_MODE (op)))
real_convert (&d, mode, &d);
break;
case FIX:
/* Don't perform the operation if flag_signaling_nans is on
and the operand is a signaling NaN. */
- if (!(HONOR_SNANS (mode) && REAL_VALUE_ISSIGNALING_NAN (d)))
- real_arithmetic (&d, FIX_TRUNC_EXPR, &d, NULL);
+ if (HONOR_SNANS (mode) && REAL_VALUE_ISSIGNALING_NAN (d))
+ return NULL_RTX;
+ real_arithmetic (&d, FIX_TRUNC_EXPR, &d, NULL);
break;
case NOT:
{