This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/69910] ICE with NEWUNIT in module
- From: "jvdelisle at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 23 Feb 2016 01:10:11 +0000
- Subject: [Bug fortran/69910] ICE with NEWUNIT in module
- Auto-submitted: auto-generated
- References: <bug-69910-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69910
--- Comment #2 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
Test case:
module newunit_bug
implicit none
contains
subroutine open_file_safe(fname, fstatus, faction, fposition, funit)
character(*), intent(in) :: fname, fstatus, faction, fposition
integer, intent(out) :: funit
integer :: istat
select case (fstatus)
case ('scratch')
open(newunit=funit, status=fstatus, access='sequential', &
form='formatted', iostat=istat)
case default
open(newunit=funit, file=fname, status=fstatus, access='sequential', &
form='formatted', action=faction, position=fposition, iostat=istat)
end select
end subroutine open_file_safe
end module newunit_bug