re PR fortran/84412 (Erroneous "Inquire statement identifies an internal file" error)

2018-02-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/84412
	* io/transfer.c (finalize_transfer): After completng an internal unit
	I/O operation, clear internal_unit_kind.

From-SVN: r257791
This commit is contained in:
Jerry DeLisle 2018-02-18 15:32:39 +00:00
parent 9bbbdb49b4
commit d5efbf3fd5
3 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,11 @@
! { dg-do run }
! PR84412 Wrong "Inquire statement identifies an internal file" error
program bug
implicit none
integer :: i
character(len=1) :: s
write (s,'(i1)') 0
open(newUnit=i,file='inquire_18.txt',status='unknown')
inquire(unit=i)
close(i, status="delete")
end program bug

View File

@ -1,3 +1,9 @@
2018-02-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/84412
* io/transfer.c (finalize_transfer): After completng an internal unit
I/O operation, clear internal_unit_kind.
2018-02-12 Thomas Koenig <tkoenig@gcc.gnu.org>
* libgfortran.h (GFC_ARRAY_DESCRIPTOR): Remove dimension

View File

@ -3993,6 +3993,10 @@ finalize_transfer (st_parameter_dt *dtp)
if (dtp->u.p.unit_is_internal)
{
/* The unit structure may be reused later so clear the
internal unit kind. */
dtp->u.p.current_unit->internal_unit_kind = 0;
fbuf_destroy (dtp->u.p.current_unit);
if (dtp->u.p.current_unit
&& (dtp->u.p.current_unit->child_dtio == 0)