]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Testcase for PR70102
authorRichard Biener <rguenther@suse.de>
Wed, 29 Oct 2025 10:49:06 +0000 (11:49 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 29 Oct 2025 10:50:57 +0000 (11:50 +0100)
We are now able to vectorize the PR70102 testcase using a SLP reduction chain.

PR tree-optimization/70102
* gfortran.dg/vect/pr70102.f: New testcase.

gcc/testsuite/gfortran.dg/vect/pr70102.f [new file with mode: 0644]

diff --git a/gcc/testsuite/gfortran.dg/vect/pr70102.f b/gcc/testsuite/gfortran.dg/vect/pr70102.f
new file mode 100644 (file)
index 0000000..b6a2878
--- /dev/null
@@ -0,0 +1,21 @@
+! { dg-do compile }
+! { dg-additional-options "-Ofast" }
+      subroutine test (x,y,z)
+      integer x,y,z
+      real*8 a(5,x,y,z),b(5,x,y,z)
+      real*8 c
+
+      c = 0.0d0
+      do k=1,z
+         do j=1,y
+           do i=1,x
+              do l=1,5
+                 c = c + a(l,i,j,k)*b(l,i,j,k)
+              enddo
+           enddo
+         enddo
+      enddo
+      write(30,*)'c ==',c
+      return
+      end
+! { dg-final { scan-tree-dump "vectorizing a reduction chain" "vect" { target vect_double } } }