1! { dg-do compile }
2! { dg-options "-O2 -Wuninitialized" }
3! PR 67679 - this used to cause an undefined warning for
4! variables generated by the compiler.
5
6subroutine s(h, Gmin, r)
7
8   implicit none
9   real, intent(in) ::  Gmin(3), h(3)
10   integer, intent(inout) :: r
11
12   integer :: x_min(3), x_max(3), k, iStat
13   logical, dimension(:), allocatable :: check
14
15   do k = 1,1
16      x_min(k) = int(Gmin(k)*h(k))
17      x_max(k) = int(Gmin(k)*h(k))
18   end do
19
20   allocate(check(x_min(1):x_max(1)),stat=iStat)
21
22   check(:) = .false.
23
24   do k = x_min(1),x_max(1)
25            r = r + 1
26   end do
27
28end
29