This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix 61441 [2/5] Use REAL_VALUE_ISSIGNALING_NAN instead of REAL_VALUE_ISNAN where appropriate
- From: "Saraswati, Sujoy (OSTL)" <sujoy dot saraswati at hpe dot com>
- To: Joseph Myers <joseph at codesourcery dot com>, Sujoy Saraswati <ssaraswati at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Richard Biener <richard dot guenther at gmail dot com>
- Date: Thu, 26 Nov 2015 08:30:09 +0000
- Subject: Fix 61441 [2/5] Use REAL_VALUE_ISSIGNALING_NAN instead of REAL_VALUE_ISNAN where appropriate
- Authentication-results: sourceware.org; auth=none
This patch uses REAL_VALUE_ISSIGNALING_NAN instead of REAL_VALUE_ISNAN to avoid the operation for sNaN.
Regards,
Sujoy
2015-11-26 Sujoy Saraswati <sujoy.saraswati@hpe.com>
PR tree-optimization/61441
* fold-const.c (const_binop): Use REAL_VALUE_ISSIGNALING_NAN instead
of REAL_VALUE_ISNAN to avoid the operation for sNaN.
* simplify-rtx.c (simplify_const_binary_operation) Same.
Index: gcc/fold-const.c
===================================================================
--- gcc/fold-const.c (revision 230851)
+++ gcc/fold-const.c (working copy)
@@ -1150,9 +1150,10 @@ const_binop (enum tree_code code, tree arg1, tree
mode = TYPE_MODE (type);
/* Don't perform operation if we honor signaling NaNs and
- either operand is a NaN. */
+ either operand is a signaling NaN. */
if (HONOR_SNANS (mode)
- && (REAL_VALUE_ISNAN (d1) || REAL_VALUE_ISNAN (d2)))
+ && (REAL_VALUE_ISSIGNALING_NAN (d1)
+ || REAL_VALUE_ISSIGNALING_NAN (d2)))
return NULL_TREE;
/* Don't perform operation if it would raise a division
Index: gcc/simplify-rtx.c
===================================================================
--- gcc/simplify-rtx.c (revision 230851)
+++ gcc/simplify-rtx.c (working copy)
@@ -3892,7 +3892,8 @@ simplify_const_binary_operation (enum rtx_code cod
real_convert (&f1, mode, CONST_DOUBLE_REAL_VALUE (op1));
if (HONOR_SNANS (mode)
- && (REAL_VALUE_ISNAN (f0) || REAL_VALUE_ISNAN (f1)))
+ && (REAL_VALUE_ISSIGNALING_NAN (f0)
+ || REAL_VALUE_ISSIGNALING_NAN (f1)))
return 0;
if (code == DIV