aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorHao Liu <hliu@os.amperecomputing.com>2024-03-20 17:37:01 +0800
committerHao Liu <hliu@os.amperecomputing.com>2024-03-20 17:38:32 +0800
commit4c276896d646c2dbc8047fd81d6e65f8c5ecf01d (patch)
tree0371f5d8c78194ce20868181da56518ec078b33d /gcc
parent0ba773df160ab1552d76eb51248d0b4d4ca86fae (diff)
downloadgcc-4c276896d646c2dbc8047fd81d6e65f8c5ecf01d.zip
gcc-4c276896d646c2dbc8047fd81d6e65f8c5ecf01d.tar.gz
gcc-4c276896d646c2dbc8047fd81d6e65f8c5ecf01d.tar.bz2
testsuite: add the case to cover the vectorization of A[(i+x)*stride] [PR114322]
This issues has been fixed by r14-9540-ge0e9499a in PR114151. Tested on aarch64-linux-gnu. gcc/testsuite/ChangeLog: PR tree-optimization/114322 * gcc.dg/vect/pr114322.c: New testcase.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr114322.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/pr114322.c b/gcc/testsuite/gcc.dg/vect/pr114322.c
new file mode 100644
index 0000000..2642abf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr114322.c
@@ -0,0 +1,20 @@
+/* PR tree-optimization/114322 */
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+int
+foo (int *A, int *B, int x, int stride)
+{
+ int sum = 0;
+
+ if (stride > 1)
+ {
+ for (int i = 0; i < 1024; ++i)
+ sum += A[(i + x) * stride] + B[i];
+ }
+
+ return sum;
+}
+
+/* { dg-final { scan-tree-dump-not "failed: evolution of base is not affine." "vect" } } */
+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */