Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gfortran.dg / pr42108.f90
blobe97dc3756f8c503892b00ee46a43d6295fb3ea1b
1 ! { dg-do compile }
2 ! { dg-options "-O2 -fdump-tree-fre" }
4 subroutine eval(foo1,foo2,foo3,foo4,x,n,nnd)
5 implicit real*8 (a-h,o-z)
6 dimension foo3(n),foo4(n),x(nnd)
7 nw=0
8 foo3(1)=foo2*foo4(1)
9 do i=2,n
10 foo3(i)=foo2*foo4(i)
11 do j=1,i-1
12 temp=0.0d0
13 jmini=j-i
14 do k=i,nnd,n
15 temp=temp+(x(k)-x(k+jmini))**2
16 end do
17 temp = sqrt(temp+foo1)
18 foo3(i)=foo3(i)+temp*foo4(j)
19 foo3(j)=foo3(j)+temp*foo4(i)
20 end do
21 end do
22 end subroutine eval
24 ! There should be only one load from n left
26 ! { dg-final { scan-tree-dump-times "\\*n_" 1 "fre" } }
27 ! { dg-final { cleanup-tree-dump "fre" } }