Hi all,

Following up on Josephs' comments on PR 61876 this patch guards the rint + cast -> lrint transformation on -fno-math-errno.

Bootstrapped and tested on aarch64-linux and x86.

Ok for trunk?

Thanks,
Kyrill

2014-08-04  Kyrylo Tkachov  <kyrylo.tkac...@arm.com>

    * convert.c (convert_to_integer): Guard transformation to lrint by
    -fno-math-errno.
commit e519f002ee27701b1b890dd8b303dc45d4e4595c
Author: Kyrylo Tkachov <kyrylo.tkac...@arm.com>
Date:   Fri Jul 25 16:21:23 2014 +0100

    [convert.c] Guard transform to lrint with -fno-math-errno

diff --git a/gcc/convert.c b/gcc/convert.c
index 8dbf3cb..3834351 100644
--- a/gcc/convert.c
+++ b/gcc/convert.c
@@ -477,8 +477,8 @@ convert_to_integer (tree type, tree expr)
 	    break;
 	  /* ... Fall through ...  */
 	CASE_FLT_FN (BUILT_IN_RINT):
-	  /* Only convert in ISO C99 mode.  */
-	  if (!targetm.libc_has_function (function_c99_misc))
+	  /* Only convert in ISO C99 mode and with -fno-math-errno.  */
+	  if (!targetm.libc_has_function (function_c99_misc) || flag_errno_math)
 	    break;
 	  if (outprec < TYPE_PRECISION (integer_type_node)
 	      || (outprec == TYPE_PRECISION (integer_type_node)

Reply via email to