1! { dg-do compile }
2! { dg-options "-O -fdump-tree-fre1" }
3
4module test_module
5  integer, parameter :: r=10
6   integer :: data(r, r), block(r, r, r)
7  contains
8recursive subroutine foo(arg)
9integer, intent(in) :: arg
10integer :: loop, x(r), y(r)
11
12   where(data(arg, :) /= 0)
13      x = data(arg, :)
14       y = l
15   elsewhere
16      x = 1
17      y = r
18   end where
19
20do loop = x(1), y(1)
21   if(block(arg, 1, loop) <= 0) cycle
22   block(arg, 1:4, loop) =  block(arg, 1:4, i1) + 1
23   call foo(arg + 2)
24   block(arg, 1:4, loop) = block(arg, 1:4, i1) + 10
25end do
26end subroutine foo
27
28end module test_module
29end program
30
31! { dg-final { scan-tree-dump-times "= \\*arg_\[0-9\]+\\(D\\);" 1 "fre1" } }
32