aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSujoy Saraswati <sujoy.saraswati@hpe.com>2015-12-20 09:20:57 +0000
committerSujoy Saraswati <ssaraswati@gcc.gnu.org>2015-12-20 09:20:57 +0000
commitafeb246c1bb0b5496dfd133c70fef9d9fff722ac (patch)
tree5baf4f1c4924072980834f8000966921cbe042f5
parent683aa9290bad382f137c9f205a91b3d8c78aecd6 (diff)
downloadgcc-afeb246c1bb0b5496dfd133c70fef9d9fff722ac.zip
gcc-afeb246c1bb0b5496dfd133c70fef9d9fff722ac.tar.gz
gcc-afeb246c1bb0b5496dfd133c70fef9d9fff722ac.tar.bz2
This series of patches fix PR61441.
This series of patches fix PR61441. This patch removes flag_errno_math check for RINT, treating it similar to nearbyint. Bootstrapped & regression-tested on x86_64-linux-gnu. gcc/ * match.pd (f(x) -> x): Removed flag_errno_math check for RINT. From-SVN: r231858
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/match.pd8
2 files changed, 6 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b7a1469..d8b5be3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,6 +1,11 @@
2015-12-20 Sujoy Saraswati <sujoy.saraswati@hpe.com>
PR tree-optimization/61441
+ * match.pd (f(x) -> x): Removed flag_errno_math check for RINT.
+
+2015-12-20 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 operands.
* simplify-rtx.c (simplify_const_binary_operation): Same.
diff --git a/gcc/match.pd b/gcc/match.pd
index 5ac30eb..1674a14 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -2566,16 +2566,10 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(fns (fns @0))
(fns @0)))
/* f(x) -> x if x is integer valued and f does nothing for such values. */
-(for fns (TRUNC FLOOR CEIL ROUND NEARBYINT)
+(for fns (TRUNC FLOOR CEIL ROUND NEARBYINT RINT)
(simplify
(fns integer_valued_real_p@0)
@0))
-/* Same for rint. We have to check flag_errno_math because
- integer_valued_real_p accepts +Inf, -Inf and NaNs as integers. */
-(if (!flag_errno_math)
- (simplify
- (RINT integer_valued_real_p@0)
- @0))
/* hypot(x,0) and hypot(0,x) -> abs(x). */
(simplify