[patch, fortran] Separate READ from WRITE

Thomas Koenig tkoenig@netcologne.de
Tue Oct 12 22:18:00 GMT 2010


Hi Tobias,

> Thus, I think the first argument should be "w" (i.e. the attribute 
> should start with ".w"). However, I have still the feeling that READ
> and 
> thus transfer_logical should have ".wW" (as it is now) while WRITE 
> should have ".wR" (and not ".rW"). Recall in that the first item in
> the 
> string (".") skips over the *return value* (which here is "void").
> The 
> last argument (int4 len) has no spec as it is passed by value and
> thus 
> does not need a fn-spec 

After having read the source in tree.h, I concur.  

Here's the updated patch; currently regression-testing. Note the small
"r" for the array transfer.

OK if it passes?  I'll only be able to commit this on the weekend, due
to business travel.

	Thomas

2010-10-11  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/20165
	PR fortran/31593
	PR fortran/43665
	* gfortran.map:  Add _gfortran_transfer_array_write,
	_gfortran_transfer_array_write, _gfortran_transfer_character_write,
	_gfortran_transfer_character_wide_write,
	_gfortran_transfer_complex_write,
	_gfortran_transfer_integer_write,
	_gfortran_transfer_logical_write and
	_gfortran_transfer_real_write.
	* io/transfer.c (transfer_integer_write):  Add prototype and
	function body as call to the original function, without the
	_write.
	(transfer_real_write):  Likewise.
	(transfer_logical_write):  Likewise.
	(transfer_character_write):  Likewise.
	(transfer_character_wide_write):  Likewise.
	(transfer_complex_write):  Likewise.
	(transfer_array_write):  Likewise.

2010-10-11  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/20165
	PR fortran/31593
	PR fortran/43665
	* trans-io.c (enum iocall): Add IOCALL_X_INTEGER_WRITE,
	IOCALL_X_LOGICAL_WRITE, IOCALL_X_CHARACTER_WRITE,
	IOCALL_X_CHARACTER_WIDE_WRIE, IOCALL_X_REAL_WRITE,
	IOCALL_X_COMPLEX_WRITE and IOCALL_X_ARRAY_WRITE.
	(gfc_build_io_library_fndecls):  Add corresponding function
	decls.
	(transfer_expr):  If the current transfer is a READ, use
	the iocall with the original version, otherwise the version
	with _WRITE.
	(transfer_array_desc):  Likewise.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: p4.diff
Type: text/x-patch
Size: 12026 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20101012/530a6b07/attachment.bin>


More information about the Fortran mailing list