Error in PGI f90, V7.0.4 (Linux x86-64 and Win-32)

The pgf90 compiler aborts with an “illegal access” violation for this simple program:

$ cat tst.f90

program tst
implicit none
integer :: i
do i=1,3
   call sub()
end do
stop

contains

subroutine sub()
implicit none
integer,save :: i=0
character , dimension(3) :: exitc*4=(/ ('EXIT',i=1,3) /)
write(*,'(T2,"Exit = ",3A4)')exitc
i=i+1
exitc(i)(2:2)='U'
return
end subroutine sub

end program tst

$ pgf90 tst.f90

pgf90-Fatal-/opt/pgi/linux86/7.0-4/bin/newcg/pgf902 TERMINATED by signal 11
Arguments to /opt/pgi/linux86/7.0-4/bin/newcg/pgf902
/opt/pgi/linux86/7.0-4/bin/newcg/pgf902 /tmp/pgf90U8hbk08eGIwr.ilm -fn tst.f90 -opt 1 -terse 1 -inform warn -x 51 0x20 -x 119 0xa10000 -x 119 0x100000 -x 122 0x40 -x 123 0x1000 -x 127 4 -x 127 16 -x 119 0x40000000 -x 19 0x400000 -x 28 0x40000 -x 70 0x8000 -x 122 1 -x 59 4 -tp k8-32 -x 124 0x1400 -y 15 2 -x 57 0x3b0000 -x 58 0x48000000 -astype 0 -x 124 1 -cmdline '+pgf90 tst.f90 ' -asm /tmp/pgf90E8hbAvJ7oIkj.s

$ pgf90 -V

pgf90 7.0-4 32-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.

Hi N. Shamsundar,

Thank you for the report and great example code. I have filed this as technical problem report (TPR) #4253 and sent it to our compiler team for further review.

The problem occurs with the data initialization of exitc. As a work around you can apply the following source changes:

% cat tmp.f90
program tst
implicit none
integer :: i
do i=1,3
   call sub()
end do
stop

contains

subroutine sub()
implicit none
integer,save :: i=0
character , dimension(3) :: exitc*4

if (i.eq.0) then
  exitc=(/ ('EXIT',i=1,3) /)
endif
write(*,'(T2,"Exit = ",3A4)')exitc
i=i+1
exitc(i)(2:2)='U'
return
end subroutine sub

end program tst
% pgf90 -V7.0-4 tmp.f90
% a.out
 Exit = EXITEXITEXIT
 Exit = EUITEXITEXIT
 Exit = EUITEUITEXIT
FORTRAN STOP

Again, thank you for bringing this problem to our attention.

Best Regards,
Mat