PR target/84827
* config/i386/i386.md (round<mode>2): For 387 fancy math, disable
pattern if -ftrapping-math -fno-fp-int-builtin-inexact.
* gcc.target/i386/pr84827.c: New test.
From-SVN: r258477
2018-03-13 Jakub Jelinek <jakub@redhat.com>
+ PR target/84827
+ * config/i386/i386.md (round<mode>2): For 387 fancy math, disable
+ pattern if -ftrapping-math -fno-fp-int-builtin-inexact.
+
PR target/84828
* reg-stack.c (change_stack): Change update_end var from int to
rtx_insn *, if non-NULL don't update just BB_END (current_block), but
"(TARGET_USE_FANCY_MATH_387
&& (!(SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
|| TARGET_MIX_SSE_I387)
- && flag_unsafe_math_optimizations)
+ && flag_unsafe_math_optimizations
+ && (flag_fp_int_builtin_inexact || !flag_trapping_math))
|| (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH
&& !flag_trapping_math && !flag_rounding_math)"
{
2018-03-13 Jakub Jelinek <jakub@redhat.com>
+ PR target/84827
+ * gcc.target/i386/pr84827.c: New test.
+
PR target/84828
* g++.dg/ext/pr84828.C: New test.
--- /dev/null
+/* PR target/84827 */
+/* { dg-do compile } */
+/* { dg-options "-Ofast -fno-fp-int-builtin-inexact -ftrapping-math -fno-associative-math -mfpmath=387" } */
+
+double
+f1 (double a)
+{
+ return __builtin_round (a);
+}
+
+float
+f2 (float a)
+{
+ return __builtin_roundf (a);
+}
+
+long double
+f3 (long double a)
+{
+ return __builtin_roundl (a);
+}