[Fwd: [PATCH, libgfortran] Fix PR26890 SIZE parameter interacts with variable in IO list]

Jerry DeLisle jvdelisle@verizon.net
Thu Mar 30 05:44:00 GMT 2006


:ADDPATCH fortran:  Forgot the patch tracker.

-------- Original Message --------
Subject: [PATCH, libgfortran] Fix PR26890 SIZE parameter interacts with variable 
in IO list
Date: Wed, 29 Mar 2006 21:37:11 -0800
From: Jerry DeLisle <jvdelisle@verizon.net>
To: Fortran List <fortran@gcc.gnu.org>, gcc-patches <gcc-patches@gcc.gnu.org>

Hello Folks,

The attached patch fixes this bug by adding a new variable to the dtp structure
in io.h.  The pad variable size is adjusted by the sizeof (gfc_offset) to
compensate for this (to keep the structure size identical).  I have not
identified any other use for this padding that is there. (Please comment if you
know anything about it)

The new variable, size_used, is used to accumulate the bytes read or written.
The SIZE parameter is then set to the accumulated value when the transfer is
complete.

Regression tested, NIST tested, io tested.  See attached test case.

OK for trunk?  What about 4.1.1?

Regards Jerry

2006-03-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/26890
	* io/io.h: Add size_used to st_parameter_dt, adjust pad size.
	*io/transfer.c (data_transfer_init): Initialize size_used to zero.
	(read_sf): Use size_used.
	(read_block): Likewise.
	(read_block_direct): Likewise.
	(write_block): Likewise.
	(write_buf): Likewise and eliminate erroneous FAILURE return.
	(finalize_transfer): Assign value of size_used to *dtp->size.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr26890.diff
Type: text/x-patch
Size: 4021 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060330/be584402/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: read_size_noadvance.f90
Type: application/x-extension-f90
Size: 719 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20060330/be584402/attachment-0001.bin>


More information about the Fortran mailing list