| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-ffrontend-optimize" } |
| 3 |
! PR fortran/88073 - this used to ICE with front-end optimization |
| 4 |
! Original test case by 'mecej4' |
| 5 |
Subroutine tfu (n, x, f) |
| 6 |
Implicit None |
| 7 |
Integer, Parameter :: double = Kind (0.d0) |
| 8 |
Integer, Intent (In) :: n |
| 9 |
Real (double), Intent (Out) :: f |
| 10 |
Real (double), Intent (In) :: x (n) |
| 11 |
Integer :: j |
| 12 |
Logical, Dimension(n) :: l1v, l2v, l3v |
| 13 |
! |
| 14 |
l3v = .False. |
| 15 |
l2v = .False. |
| 16 |
l1v = (/ (j, j=1, n) /) == 1 |
| 17 |
Where ( .Not. (l1v)) |
| 18 |
l2v = (/ (j, j=1, n) /) == n |
| 19 |
End Where |
| 20 |
Where ( .Not. l1v) |
| 21 |
l3v = .Not. l2v |
| 22 |
End Where |
| 23 |
f = sum (x(1:n), mask=l3v) |
| 24 |
Return |
| 25 |
end subroutine tfu |