aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/compile/20030804-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/compile/20030804-1.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20030804-1.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/20030804-1.c b/gcc/testsuite/gcc.c-torture/compile/20030804-1.c
new file mode 100644
index 00000000000..189fde3cee5
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20030804-1.c
@@ -0,0 +1,9 @@
+/* Extracted from PR middle-end/11771. */
+/* The following testcase used to ICE without -ffast-math from unbounded
+ recursion in fold. This was due to the logic in negate_expr_p not
+ matching that in negate_expr. */
+
+double f(double x) {
+ return -(1 - x) + (x ? -(1 - x) : 0);
+}
+