public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-9569] testsuite: add the case to cover the vectorization of A[(i+x)*stride] [PR114322]
@ 2024-03-20 9:39 Hao Liu
0 siblings, 0 replies; only message in thread
From: Hao Liu @ 2024-03-20 9:39 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:4c276896d646c2dbc8047fd81d6e65f8c5ecf01d
commit r14-9569-g4c276896d646c2dbc8047fd81d6e65f8c5ecf01d
Author: Hao Liu <hliu@os.amperecomputing.com>
Date: Wed Mar 20 17:37:01 2024 +0800
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.
Diff:
---
gcc/testsuite/gcc.dg/vect/pr114322.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/gcc/testsuite/gcc.dg/vect/pr114322.c b/gcc/testsuite/gcc.dg/vect/pr114322.c
new file mode 100644
index 00000000000..2642abf3718
--- /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" } } */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-03-20 9:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-20 9:39 [gcc r14-9569] testsuite: add the case to cover the vectorization of A[(i+x)*stride] [PR114322] Hao Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).