| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-ffrontend-optimize" } |
| 3 |
! |
| 4 |
! PR fortran/60341 |
| 5 |
! An unguarded union access was wrongly enabling a frontend optimization on a |
| 6 |
! string comparison, leading to an ICE. |
| 7 |
! |
| 8 |
! Original testcase from Steve Chapel <[email protected]>. |
| 9 |
! Reduced by Steven G. Kargl <[email protected]>. |
| 10 |
! |
| 11 |
|
| 12 |
subroutine modelg(ncm) |
| 13 |
implicit none |
| 14 |
integer, parameter :: pc = 30, pm = pc - 1 |
| 15 |
integer i |
| 16 |
character*4 catt(pm,2) |
| 17 |
integer ncm,iatt(pm,pc) |
| 18 |
do i=1,ncm |
| 19 |
if (catt(i,1)//catt(i,2).eq.'central') exit |
| 20 |
end do |
| 21 |
iatt(i,4)=1 |
| 22 |
end |