[patch, libgfortran] PR 31915 - fix reading/writing of real(10) variables with convert="SWAP"

Tobias Burnus burnus@net-b.de
Tue May 15 10:20:00 GMT 2007


Hi Janne,

Janne Blomqvist wrote:
> Tobias Burnus wrote:
>> Updated patch below. Regression test is still running, but assuming it
>> succeeded, is the patch ok for trunk and 4.2.1?   
> You should fix the comments a few lines above your changes about the
> padding, which are no longer correct with your patch.
Thanks, I somehow missed them.


> That being said, I'm not convinced this is the right approach. We
> waste disk BW and space by including the pad bits; using the kind and
> not the size was IIRC a conscious decision back when the endian
> conversion patch was made. For "normal" situations this is justified,
> since that allows us to transfer lots of elements from an array in one
> go, but with endian conversion, we have to do it element by element
> anyways.
But if one does include the padding with convert=NATIVE on e.g. a
little-endian machine, one also need to do it when reading the same file
on a big-endian machine with convert=BIG_ENDIAN, or not? (Assuming that
sizeof(real(10) is the same on both platform.)

> (with the caveat that other platforms may pad differently, as I
> mentioned in my email linked above)
Well, fortunately, real(10) is only rarely used and "convert" is also
rarely used which means that it this padding problem does not affect
many users.

> Additionally taking into account that it does fix a bug, I guess it's
> ok for trunk (with the comment fixes).
Committed patch attached.

> Wait for a week or so before committing to the 4.2 branch to give
> people on non-Linux/x86 platforms time to test.
Well, I have to wait anyhow until the branch opens again. Currently it
is still frozen, I think. (Or not? It has been tagged and the FTP files
are released already.) In addition, I better wait until Dominique's
testsuite patch is in, otherwise testing data is missing too.

Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: convert.diff
Type: text/x-patch
Size: 1715 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070515/785e5174/attachment.bin>


More information about the Fortran mailing list