[patch, libfortran] PR 34565, internal write with negative strides

Thomas Koenig tkoenig@netcologne.de
Wed Jan 2 10:59:00 GMT 2008


Hello world,

here's a patch for internal I/O with negative array strides.  This was
a bit tricky, due to the separation of stream I/O and the number of
places that needed to be touched.

Regression-tested on i686-pc-linux-gnu.

OK for trunk?

	Thomas

2008-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34565
	* io/io.h:  Adjust protoypes for open_internal(),
	next_array_record() and init_loop_spec().
	* io/list_read.c (next_char):  Use argument "finished"
	of next_array_record to check for end on internal file.
	* io/unit.c:  Calculate the offset for an array
	internal file and supply this informatin to open_internal().
	* io/unix.c (open_internal):  Set the offset for the internal
	file on open.
	* io/transfer.c (init_loop_spec):  Calculate the starting
	record in case of negative strides.  Return size of 0 for
	an empty array.
	(next_array_record):  Use an extra flag to signal that the
	array is finished.
	(next_record_r):  Use the new flag to next_array_record().
	(next_record_w):  Likewise.

2008-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/34565
	* gfortran.dg/internal_readwrite_1.f90:  New test.
	* gfortran.dg/internal_readwrite_2.f90:  New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff-10
Type: text/x-patch
Size: 6818 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20080102/3ac2b080/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: internal_readwrite_1.f90
Type: text/x-fortran
Size: 443 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20080102/3ac2b080/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: internal_readwrite_2.f90
Type: text/x-fortran
Size: 497 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20080102/3ac2b080/attachment-0002.bin>


More information about the Fortran mailing list