1! { dg-do compile }
2! PR 60522 - this used to ICE.
3! Original test case Roger Ferrer Ibanez
4subroutine foo(a, b)
5   implicit none
6   integer, dimension(:), intent(inout) :: a
7   integer, dimension(:), intent(in) :: b
8
9   where (b(:) > 0)
10      where (b(:) > 100)
11         a(lbound(a, 1):ubound(a, 1)) = b(lbound(b, 1):ubound(b, 1)) * b(lbound(b, 1):ubound(b, 1)) - 100
12      elsewhere
13         a(lbound(a, 1):ubound(a, 1)) = b(lbound(b, 1):ubound(b, 1)) * b(lbound(b, 1):ubound(b, 1))
14      end where
15   elsewhere
16      a(lbound(a, 1):ubound(a, 1)) = - b(lbound(b, 1):ubound(b, 1)) * b(lbound(b, 1):ubound(b, 1))
17   end where
18end subroutine foo
19