]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/11311 (ICE with pow and large exponent)
authorRoger Sayle <roger@eyesopen.com>
Wed, 25 Jun 2003 03:09:06 +0000 (03:09 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Wed, 25 Jun 2003 03:09:06 +0000 (03:09 +0000)
PR optimization/11311
* builtins.c (powi_cost): Fix typo.  The number of multiplications
required is the number to reduce the argument, result, plus the
cost of calculating the residual, val [not n, the original value].

* gcc.c-torture/compile/20030624-1.c: New test case.

From-SVN: r68452

gcc/ChangeLog
gcc/builtins.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20030624-1.c [new file with mode: 0644]

index 9163bb2919491f910cf8ddfc1a701a98ca4fc0f7..e0bfc15586a67f42cf32896bbf99cffb3b4bbdc0 100644 (file)
@@ -1,3 +1,10 @@
+2003-06-24  Roger Sayle  <roger@eyesopen.com>
+
+       PR optimization/11311
+       * builtins.c (powi_cost): Fix typo.  The number of multiplications
+       required is the number to reduce the argument, result, plus the
+       cost of calculating the residual, val [not n, the original value].
+
 2003-06-24  Roger Sayle  <roger@eyesopen.com>
 
        * config/alpha/osf5.h (TARGET_C99_FUNCTIONS): Define.
index 372c0c2f4371379e60498b9063ddbc70c3e871f7..3c4268fd62d467b7b6a356c727ae0238eeef5f7f 100644 (file)
@@ -2068,7 +2068,7 @@ powi_cost (HOST_WIDE_INT n)
        }
     }
   
-  return result + powi_lookup_cost (n, cache);
+  return result + powi_lookup_cost (val, cache);
 }
 
 /* Recursive subroutine of expand_powi.  This function takes the array,
index 2b8cff0ef363e8880bc34c5a3b3b27cd04866c5b..b2497a35228e05d629366cf924a7bb9ab48b6013 100644 (file)
@@ -1,3 +1,7 @@
+2003-06-24  Roger Sayle  <roger@eyesopen.com>
+
+       * gcc.c-torture/compile/20030624-1.c: New test case.
+
 2003-06-24  Jakub Jelinek  <jakub@redhat.com>
 
        * gcc.c-torture/execute/string-opt-17.c: New test.
diff --git a/gcc/testsuite/gcc.c-torture/compile/20030624-1.c b/gcc/testsuite/gcc.c-torture/compile/20030624-1.c
new file mode 100644 (file)
index 0000000..9c293fc
--- /dev/null
@@ -0,0 +1,6 @@
+/* Derived from PR optimization/11311 */
+
+double pow(double, double);
+
+double foo(double x) { return pow(x,261); }
+