OSDN Git Service

2007-11-26 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 26 Nov 2007 12:30:40 +0000 (12:30 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 26 Nov 2007 12:30:40 +0000 (12:30 +0000)
PR middle-end/34233
* builtins.c (expand_builtin_pow): Use expand_expr to expand
the result of build_call_expr.

* gcc.dg/pr34233.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130436 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 4a6466c..76daadc 100644 (file)
@@ -1,3 +1,9 @@
+2007-11-26  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/34233
+       * builtins.c (expand_builtin_pow): Use expand_expr to expand
+       the result of build_call_expr.
+
 2007-11-26  Steven Bosscher  <stevenb.gcc@gmail.com> 
            Revital Eres  <eres@il.ibm.com> 
 
index 4f4cba2..1eb6cfc 100644 (file)
@@ -2938,7 +2938,9 @@ expand_builtin_pow (tree exp, rtx target, rtx subtarget)
              || n == 1))
        {
          tree call_expr = build_call_expr (fn, 1, narg0);
-         op = expand_builtin (call_expr, NULL_RTX, subtarget, mode, 0);
+         /* Use expand_expr in case the newly built call expression
+            was folded to a non-call.  */
+         op = expand_expr (call_expr, subtarget, mode, EXPAND_NORMAL);
          if (n != 1)
            {
              op2 = expand_expr (narg0, subtarget, VOIDmode, EXPAND_NORMAL);
index cb45e6e..d90427f 100644 (file)
@@ -1,3 +1,8 @@
+2007-11-26  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/34233
+       * gcc.dg/pr34233.c: New testcase.
+
 2007-11-26  Steven Bosscher  <stevenb.gcc@gmail.com>
            Revital Eres  <eres@il.ibm.com>
 
diff --git a/gcc/testsuite/gcc.dg/pr34233.c b/gcc/testsuite/gcc.dg/pr34233.c
new file mode 100644 (file)
index 0000000..1982efa
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-ffast-math" } */
+
+double foo(void)
+{
+  return __builtin_pow (0.0, -1.5);
+}
+