Hi Jerry, This is OK for trunk.
Thanks for doing this. Hopefully we will have a really good implementation of UD-DTIO in time for the release of 7.1. I am progressing through submodule bugs for the same reason. Cheers Paul On 10 March 2017 at 18:17, Jerry DeLisle <jvdeli...@charter.net> wrote: > 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 <jvdeli...@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 <jvdeli...@gcc.gnu.org> > > PR libgfortran/78854 > * gfortran.dg/dtio_25.f90: New test. -- "If you can't explain it simply, you don't understand it well enough" - Albert Einstein