aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2003-06-25 03:09:06 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2003-06-25 03:09:06 +0000
commitb9ba01a11f30733eb45554f8820d4084724d308c (patch)
treeda8cc71e080c9c80fb51d977f772e2ab0cd2130a
parent465129420d1a2905e4e20ce8af772b6e13700c98 (diff)
downloadgcc-b9ba01a11f30733eb45554f8820d4084724d308c.zip
gcc-b9ba01a11f30733eb45554f8820d4084724d308c.tar.gz
gcc-b9ba01a11f30733eb45554f8820d4084724d308c.tar.bz2
re PR rtl-optimization/11311 (ICE with pow and large exponent)
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
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/builtins.c2
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20030624-1.c6
4 files changed, 18 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9163bb2..e0bfc15 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
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.
2003-06-24 Richard Henderson <rth@redhat.com>
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 372c0c2..3c4268f 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -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,
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2b8cff0..b2497a3 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..9c293fc
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20030624-1.c
@@ -0,0 +1,6 @@
+/* Derived from PR optimization/11311 */
+
+double pow(double, double);
+
+double foo(double x) { return pow(x,261); }
+