summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2003-08-20 21:55:01 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2003-08-20 21:55:01 +0000
commit1aa79290e4cc570909c029c9123239927b410ec1 (patch)
tree88d6977647ab81cb19002238244071fc6b74411d /gcc/testsuite/gcc.dg
parent4754934763ee7476140c80579bf20f46dc87ce5d (diff)
downloadgcc-1aa79290e4cc570909c029c9123239927b410ec1.tar.gz
PR middle-end/11984
* fold-const.c (fold <PLUS_EXPR>): Check for integer constant operands before calling tree_int_cst_lt when performing associative transformations. * gcc.dg/20030820-1.c: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70618 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/20030820-1.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/20030820-1.c b/gcc/testsuite/gcc.dg/20030820-1.c
new file mode 100644
index 00000000000..f86fb3978f4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20030820-1.c
@@ -0,0 +1,13 @@
+/* PR middle-end/11984 */
+/* The following program used to ICE in fold because we didn't check
+ whether the constants we were reassociating were integer constants
+ before calling tree_int_cst_lt. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -ffast-math" } */
+
+double f(double x)
+{
+ return 1.0 - x - 0.1;
+}
+