From d24078c0f3fdbef71bb5ab58f094462a6dd61b1b Mon Sep 17 00:00:00 2001 From: ssaraswati Date: Sun, 20 Dec 2015 09:20:57 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231858 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/match.pd | 8 +------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b7a146961f68..d8b5be3a1e7e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-12-20 Sujoy Saraswati + + PR tree-optimization/61441 + * match.pd (f(x) -> x): Removed flag_errno_math check for RINT. + 2015-12-20 Sujoy Saraswati PR tree-optimization/61441 diff --git a/gcc/match.pd b/gcc/match.pd index 5ac30eb078fc..1674a146790e 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 -- 2.47.2