[patch, fortran] PR30014 INQUIRE (iolength = xx) limited to kind=4

Jerry DeLisle jvdelisle@verizon.net
Wed Dec 27 11:24:00 GMT 2006


:ADDPATCH fortran:

The attached patch allows iolength and size parameters to be kind=8.  The 
restriction to default integer kind in F95 is lifted in F2003.  The patch adds a 
check for the kind for iolength similar to the existing check for the size 
parameter (there was no previous check on iolength).

This allows using integers of kind=8 for large file and large record IO 
operations without getting overflow.

A compile error is generated with -std=f95 if an integer of kind=8 is specified 
with the SIZE= in a formatted READ or IOLENGTH= in an INQUIRE.  No errors are 
given for -std=F2003 or -std=gnu, etc.

Modified two test cases and added a third, (in the patch).  I have attached an 
illustrative example case to try if you have sufficient resources. (Its not too 
bad, but I don't want this in the test suite.  It takes 6 minutes, 34 seconds to 
execute on my system).

Regression tested on x86-64.

OK for trunk, and then later 4.2?

Regards,

Jerry

2006-12-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/30014
	*io.c (resolve_tag): Don't issue error for tag_size type not being
	default integer size for -std=F2003.  Add similar check for
	tag_iolength.
	*ioparm.def: Change size and iolength parameters to ioint pointer, which
	corresponds to GFC_IO_INT on the library side.

2006-12-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/30014
	*io/io.h (st_parameter_dt): Change *size and *iolength type to
	GFC_IO_INT.
	*io/transfer.c (finalize_transfer): Cast dtp->u.p.size_used to
	GFC_IO_INT.  (iolength_transfer): Cast size * nelems to GFC_IO_INT.
	
	
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr30014.diff
Type: text/x-patch
Size: 5858 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20061227/dbaafea8/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iolength.f90
Type: text/x-fortran
Size: 554 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20061227/dbaafea8/attachment-0001.bin>


More information about the Fortran mailing list