[patch, gfortran] PR48298 DTIO, implement size=
Jerry DeLisle
jvdelisle@charter.net
Tue Oct 18 02:45:00 GMT 2016
Hi all,
The attached patch enables the size= specifier in a READ statement to work with
child DTIO procedures. This is accomplished by moving the size_used variable
from the dtp structure to the gfc_unit structure so that the accumulation of
bytes during READ is carried across the procedures via the UNIT.
As far as I know, this is the last DTIO patch needed for full implementation and
will close the PR.
After this patch is committed I plan to prepare a clean up patch to reorganize
the dtp structure and clear at least one TODO related to stream IO. The
follow-on patch will bump the major version number of libgfortran to 4.
Regression tested on x86-64-linux. New test case attached.
OK for trunk?
Jerry
2016-10-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/48298
* io/io.h: Move size_used from dtp to unit structure. Add bool
has_size to unit structure.
* read.c (read_x): Use has_size and size_used.
* transfer.c (read_sf_internal): Likewise. (read_sf): Likewise.
(read_block_form): Likewise. (read_block_form4): Likewise.
(data_transfer_init): If parent, initialize the size variables.
(finalize_transfer): Set the size variable using size_used in
gfc_unit. (write_block): Delete bogus/dead code.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: size.diff
Type: text/x-patch
Size: 5295 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20161018/2c847f9e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dtio_17.f90
Type: text/x-fortran
Size: 2184 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20161018/2c847f9e/attachment-0001.bin>
More information about the Fortran
mailing list