diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-02-21 09:08:40 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-02-21 09:08:40 +0100 |
commit | 4cd2eefc85eb5c4aba46213126b794393cf5a909 (patch) | |
tree | 0edb8a91f4a9ca357511c61e59f64a0e2399acce /gcc | |
parent | db03bf50fce59cfce72bfaf7593acd651336f213 (diff) | |
download | gcc-4cd2eefc85eb5c4aba46213126b794393cf5a909.zip gcc-4cd2eefc85eb5c4aba46213126b794393cf5a909.tar.gz gcc-4cd2eefc85eb5c4aba46213126b794393cf5a909.tar.bz2 |
re PR tree-optimization/61441 (ARM aarch64 fails to quiet signaling NaN)
PR tree-optimization/61441
* simplify-rtx.c (simplify_const_unary_operation): For
-fsignaling-nans and sNaN operand, return NULL_RTX rather than
the sNaN unmodified.
From-SVN: r245620
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/simplify-rtx.c | 19 |
2 files changed, 18 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f710536..26a3864a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2017-02-21 Jakub Jelinek <jakub@redhat.com> + + PR tree-optimization/61441 + * simplify-rtx.c (simplify_const_unary_operation): For + -fsignaling-nans and sNaN operand, return NULL_RTX rather than + the sNaN unmodified. + 2017-02-20 Bernd Edlinger <bernd.edlinger@hotmail.de> * Makefile.in (BUILD_SYSTEM_HEADER_DIR): New make variabe. diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index aa45973..fb04cd0 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -1889,23 +1889,26 @@ simplify_const_unary_operation (enum rtx_code code, machine_mode mode, 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: { |