aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2025-07-11 13:14:13 +0200
committerRichard Biener <rguenther@suse.de>2025-07-11 14:38:16 +0200
commitf451ef41bdcbf6d86397f734e1227c94b01cae17 (patch)
treeb73d4085314dd510cc1ee71bc1dc6fe2f5d731fb /gcc/testsuite
parentdc503631a5086d20e633638d8631334385f9cf13 (diff)
downloadgcc-f451ef41bdcbf6d86397f734e1227c94b01cae17.zip
gcc-f451ef41bdcbf6d86397f734e1227c94b01cae17.tar.gz
gcc-f451ef41bdcbf6d86397f734e1227c94b01cae17.tar.bz2
tree-optimization/121034 - fix reduction vectorization
The following fixes the loop following the reduction chain to properly visit all SLP nodes involved and makes the stmt info and the SLP node we track match. PR tree-optimization/121034 * tree-vect-loop.cc (vectorizable_reduction): Cleanup reduction chain following code. * gcc.dg/vect/pr121034.c: New testcase.
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr121034.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/pr121034.c b/gcc/testsuite/gcc.dg/vect/pr121034.c
new file mode 100644
index 0000000..de20781
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr121034.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-O3" } */
+
+int b, e;
+char c, d;
+unsigned g;
+int abs(int);
+void f() {
+ char *a = &d;
+ int h;
+ for (; e; e++) {
+ h = 0;
+ for (; h < 16; h++)
+ g += __builtin_abs(a[h] - c);
+ a += b;
+ }
+}