aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>2014-07-24 13:23:05 +0000
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>2014-07-24 13:23:05 +0000
commit25be91ac7e13ce5c2de638b8a5a0c4190e5cb0bf (patch)
tree212383aa1e943985b281020ae9726e957c8d9b30 /gcc
parent472411664e6343a0b203e3b74740ff8a2686b625 (diff)
downloadgcc-25be91ac7e13ce5c2de638b8a5a0c4190e5cb0bf.zip
gcc-25be91ac7e13ce5c2de638b8a5a0c4190e5cb0bf.tar.gz
gcc-25be91ac7e13ce5c2de638b8a5a0c4190e5cb0bf.tar.bz2
PR 61876: Do not convert cast + __builtin_round into __builtin_lround unless -fno-math-errno is used.
PR middle-end/61876 * convert.c (convert_to_integer): Do not convert BUILT_IN_ROUND and cast when flag_errno_math is on. From-SVN: r212989
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/convert.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 04c51e4..96a8161 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2014-07-24 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR middle-end/61876
+ * convert.c (convert_to_integer): Do not convert BUILT_IN_ROUND and cast
+ when flag_errno_math is on.
+
2014-07-24 Martin Liska <mliska@suse.cz>
* cgraph.h (varpool_node):
diff --git a/gcc/convert.c b/gcc/convert.c
index 09bc555..8dbf3cb 100644
--- a/gcc/convert.c
+++ b/gcc/convert.c
@@ -456,8 +456,8 @@ convert_to_integer (tree type, tree expr)
break;
CASE_FLT_FN (BUILT_IN_ROUND):
- /* 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)