re PR middle-end/27134 (ICE with floor and -ffast-math)
authorUros Bizjak <uros@kss-loka.si>
Fri, 14 Apr 2006 05:01:18 +0000 (07:01 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Fri, 14 Apr 2006 05:01:18 +0000 (07:01 +0200)
PR middle-end/27134
* builtins.c (expand_builtin_int_roundingfn): Use expand_normal()
to expand fallback builtin function call.

testsuite/ChangeLog:

        PR middle-end/27134
        * gcc.dg/pr27314.c: New test.

From-SVN: r112949

gcc/ChangeLog
gcc/builtins.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr27314.c [new file with mode: 0644]

index c0ccec9023e8d378fc1aa590ed40827ca07297f4..f8fdd81962a62d6f291d1a3892011d366d121a86 100644 (file)
@@ -1,3 +1,9 @@
+2005-04-13  Uros Bizjak  <uros@kss-loka.si>
+
+       PR middle-end/27134
+       * builtins.c (expand_builtin_int_roundingfn): Use expand_normal()
+       to expand fallback builtin function call.
+
 2006-04-14  Alan Modra  <amodra@bigpond.net.au>
 
        PR middle-end/27095
index c4d7ec221dc615995ccc96587126322111e52429..836f965443287d3fbead3778d992c5f946685701 100644 (file)
@@ -2312,7 +2312,7 @@ expand_builtin_int_roundingfn (tree exp, rtx target, rtx subtarget)
   gcc_assert (fallback_fndecl != NULL_TREE);
   exp = build_function_call_expr (fallback_fndecl, arglist);
 
-  tmp = expand_builtin_mathfn (exp, NULL_RTX, NULL_RTX);
+  tmp = expand_normal (exp);
 
   /* Truncate the result of floating point optab to integer
      via expand_fix ().  */
index 69bd3a2e3a909384061b11a8ea82fc33768a0bda..b19e82f66ce0590d13355420a06a9c37168b339c 100644 (file)
@@ -1,3 +1,8 @@
+2006-04-13  Uros Bizjak  <uros@kss-loka.si>
+
+       PR middle-end/27134
+       * gcc.dg/pr27314.c: New test.
+
 2006-04-13  Richard Henderson  <rth@redhat.com>
 
        * g++.dg/gomp/block-0.C: Update expected matches.
diff --git a/gcc/testsuite/gcc.dg/pr27314.c b/gcc/testsuite/gcc.dg/pr27314.c
new file mode 100644 (file)
index 0000000..d99be5e
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -ffast-math" } */
+
+extern double floor (double);
+
+inline int bar (double x)
+{
+  return (int) floor (x);
+}
+
+int foo (int i)
+{
+  return bar (i);
+}