aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/pr90018.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/vect/pr90018.c')
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr90018.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/pr90018.c b/gcc/testsuite/gcc.dg/vect/pr90018.c
new file mode 100644
index 00000000000..85c9654ceda
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr90018.c
@@ -0,0 +1,47 @@
+/* { dg-do run } */
+/* { dg-require-effective-target vect_double } */
+
+#include "tree-vect.h"
+
+void __attribute__((noinline,noclone))
+foo (double *a4, int n)
+{
+ for (int i = 0; i < n; ++i)
+ {
+ /* We may not apply interleaving to the group (a), (b) because of (c). */
+ double tem1 = a4[i*4] + a4[i*4+n*4] /* (a) */;
+ double tem2 = a4[i*4+2*n*4+1];
+ a4[i*4+n*4+1] = tem1; /* (c) */
+ a4[i*4+1] = tem2;
+ double tem3 = a4[i*4] - tem2;
+ double tem4 = tem3 + a4[i*4+n*4];
+ a4[i*4+n*4+1] = tem4 + a4[i*4+n*4+1] /* (b) */;
+ }
+}
+int main(int argc, char **argv)
+{
+ int n = 11;
+ double a4[4 * n * 3];
+ double a42[4 * n * 3];
+ check_vect ();
+ for (int i = 0; i < 4 * n * 3; ++i)
+ a4[i] = a42[i] = i;
+ foo (a4, n);
+ for (int i = 0; i < n; ++i)
+ {
+ double tem1 = a42[i*4] + a42[i*4+n*4];
+ double tem2 = a42[i*4+2*n*4+1];
+ a42[i*4+n*4+1] = tem1;
+ a42[i*4+1] = tem2;
+ double tem3 = a42[i*4] - tem2;
+ double tem4 = tem3 + a42[i*4+n*4];
+ a42[i*4+n*4+1] = tem4 + a42[i*4+n*4+1];
+ __asm__ volatile ("": : : "memory");
+ }
+ for (int i = 0; i < 4 * n * 3; ++i)
+ if (a4[i] != a42[i])
+ __builtin_abort ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "READ_WRITE dependence in interleaving" "vect" } } */