summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr81245.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/pr81245.c')
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr81245.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr81245.c b/gcc/testsuite/gcc.dg/torture/pr81245.c
new file mode 100644
index 00000000000..b2ee7bb3a9b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr81245.c
@@ -0,0 +1,16 @@
+/* { dg-options "-ffast-math" } */
+/* { dg-do compile } */
+/* This test used to crash the vectorizer as the ifconvert pass
+ used to convert the if to copysign but called update_stmt on
+ the old statement after calling fold_stmt. */
+double sg[18];
+void f(void)
+{
+ for (int i = 0 ;i < 18;i++)
+ {
+ if (sg[i] < 0.0)
+ sg[i] = -1.0;
+ else
+ sg[i] = 1.0;
+ }
+}