1! { dg-do run } 2! { dg-require-effective-target vect_double } 3! { dg-require-effective-target vect_intdouble_cvt } 4! { dg-additional-options "-fno-inline -ffast-math" } 5 subroutine foo(a,x,y,n) 6 implicit none 7 integer n,i 8 9 real*8 y(n),x(n),a 10 11 do i=1,n 12 a=a+x(i)*y(i)+x(i) 13 enddo 14 15 return 16 end 17 18 program test 19 real*8 x(1024),y(1024),a 20 do i=1,1024 21 x(i) = i 22 y(i) = i+1 23 enddo 24 call foo(a,x,y,1024) 25 if (a.ne.359488000.0) STOP 1 26 end 27! If there's no longer a reduction chain detected this doesn't test what 28! it was supposed to test, vectorizing a reduction chain w/o SLP. 29! { dg-final { scan-tree-dump "reduction chain" "vect" } } 30! We should vectorize the reduction in foo and the induction in test. 31! { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } 32