[patch, libgfortran] PR78854 [F03] DTIO namelist output not working on internal unit

Jerry DeLisle jvdelisle@charter.net
Fri Mar 10 18:17:00 GMT 2017


Hi all,

The attached patch fixes this PR by properly stashing the internal unit created 
by parent so that it may be correctly accessed by the child DTIO procedure.

Note the included test case. The Fortran Standard requires that the iotype be 
passed to the child routine so that it is aware of what the intended purpose is. 
  In the case of namelist I/O the iotype is set to "NAMELIST".  It is up to the 
user to program the child procedure to look for that and do the right thing for 
namelists to work correctly.  If a user chooses to ignore this feature, so be 
it, but tough luck if things don't work as "expected".

There are some other DTIO bugs related to this one. Once I get this patch in I 
will be able to address those more specifically.

Regression tested on x86_64.

OK for trunk?

Regards,

Jerry

2017-03-10  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/78854
	* io/list_read.c (nml_get_obj_data): Stash internal unit for
	later use by child procedures.
	* io/write.c (nml_write_obj): Likewise.
	* io/tranfer.c (data_transfer_init): Minor whitespace.
	* io/unit.c (set_internal_uit): Look for the stashed internal
	unit and use it if found.

2017-03-10  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/78854
	* gfortran.dg/dtio_25.f90: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr78854.diff
Type: text/x-patch
Size: 4243 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20170310/97603e0d/attachment.bin>


More information about the Gcc-patches mailing list