From 39b1ec97f0445bcc6e960de32e7b82011f0161ca Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Fri, 14 Apr 2006 07:01:18 +0200 Subject: [PATCH] re PR middle-end/27134 (ICE with floor and -ffast-math) 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 | 6 ++++++ gcc/builtins.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr27314.c | 14 ++++++++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/pr27314.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c0ccec9023e..f8fdd81962a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-04-13 Uros Bizjak + + PR middle-end/27134 + * builtins.c (expand_builtin_int_roundingfn): Use expand_normal() + to expand fallback builtin function call. + 2006-04-14 Alan Modra PR middle-end/27095 diff --git a/gcc/builtins.c b/gcc/builtins.c index c4d7ec221dc..836f9654432 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -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 (). */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 69bd3a2e3a9..b19e82f66ce 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-04-13 Uros Bizjak + + PR middle-end/27134 + * gcc.dg/pr27314.c: New test. + 2006-04-13 Richard Henderson * 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 index 00000000000..d99be5eb805 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr27314.c @@ -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); +} -- 2.30.2