aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorAndrew Pinski <andrew_pinski@playstation.sony.com>2007-05-21 23:08:54 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2007-05-21 16:08:54 -0700
commita50411de14fec4cf78acbe5dcc2ec0de7bb5e27f (patch)
tree4a5af0fdf3986135df36eb2ffebfc49af9eaab2a /gcc/testsuite
parent60c4429c7e517425d5e43c688b720516a5338648 (diff)
downloadgcc-a50411de14fec4cf78acbe5dcc2ec0de7bb5e27f.zip
gcc-a50411de14fec4cf78acbe5dcc2ec0de7bb5e27f.tar.gz
gcc-a50411de14fec4cf78acbe5dcc2ec0de7bb5e27f.tar.bz2
re PR tree-optimization/31995 (can't determine dependence between p->a[x+i] and p->a[x+i+1])
2007-05-21 Andrew Pinski <andrew_pinski@playstation.sony.com> PR middle-end/31995 * tree-chrec.c (evolution_function_is_affine_multivariate_p): Add loopno argument. Use evolution_function_is_invariant_rec_p instead of evolution_function_is_constant_p. Update calls to evolution_function_is_affine_multivariate_p. * tree-chrec.h (evolution_function_is_affine_multivariate_p): Add loopno argument. * tree-scalar-evolution.c (gather_chrec_stats): Call evolution_function_is_affine_multivariate_p with a loop number of 0. * tree-data-ref.c (analyze_miv_subscript): Likewise. (analyze_overlapping_iterations): Likewise. (access_functions_are_affine_or_constant_p): Likewise. (build_classic_dist_vector_1): If the access functions are equal, don't do anything. 2007-05-21 Andrew Pinski <andrew_pinski@playstation.sony.com> PR middle-end/31995 * gcc.dg/vect/vect-102a.c: New test. From-SVN: r124927
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-102a.c57
2 files changed, 62 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index af3830f..e46cf78 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2007-05-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR middle-end/31995
+ * gcc.dg/vect/vect-102a.c: New test.
+
2007-05-21 Paolo Bonzini <bonzini@gnu.org>
Paolo Carlini <pcarlini@suse.de>
Uros Bizjak <ubizjak@gmail.com>
diff --git a/gcc/testsuite/gcc.dg/vect/vect-102a.c b/gcc/testsuite/gcc.dg/vect/vect-102a.c
new file mode 100644
index 0000000..35023fc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-102a.c
@@ -0,0 +1,57 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 9
+
+struct extraction
+{
+ int a[N];
+ int b[N];
+};
+
+static int a[N] = {1,2,3,4,5,6,7,8,9};
+static int b[N] = {2,3,4,5,6,7,8,9,9};
+volatile int foo;
+
+int main1 (int x, int y) {
+ int i;
+ struct extraction *p;
+ p = (struct extraction *) malloc (sizeof (struct extraction));
+
+ for (i = 0; i < N; i++)
+ {
+ p->a[i] = a[i];
+ if (foo == 135)
+ abort (); /* to avoid vectorization */
+ }
+
+ /* Not vectorizable: distance 1. */
+ for (i = 0; i < N - 1; i++)
+ {
+ p->a[x + i] = p->a[x + i + 1];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (p->a[i] != b[i])
+ abort();
+ }
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ foo = 0;
+ return main1 (0, N);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+