This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix 61441 [3/5] Remove flag_errno_math check for RINT
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: "Saraswati, Sujoy (OSTL)" <sujoy dot saraswati at hpe dot com>
- Cc: Joseph Myers <joseph at codesourcery dot com>, Sujoy Saraswati <ssaraswati at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 26 Nov 2015 10:35:58 +0100
- Subject: Re: Fix 61441 [3/5] Remove flag_errno_math check for RINT
- Authentication-results: sourceware.org; auth=none
- References: <5379BA8D7E9D7E4D87BF6749A92854C248FC90C9 at G4W3297 dot americas dot hpqcorp dot net>
On Thu, Nov 26, 2015 at 9:31 AM, Saraswati, Sujoy (OSTL)
<sujoy.saraswati@hpe.com> wrote:
> Hi,
> This patch removes flag_errno_math check for RINT, treating it similar to nearbyint.
> Regards,
> Sujoy
Ok.
Richard.
> 2015-11-26 Sujoy Saraswati <sujoy.saraswati@hpe.com>
>
> PR tree-optimization/61441
> * match.pd (f(x) -> x): Removed flag_errno_math check for RINT.
>
> Index: gcc/match.pd
> ===================================================================
> --- gcc/match.pd (revision 230851)
> +++ gcc/match.pd (working copy)
> @@ -2565,16 +2565,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