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

Janne Blomqvist blomqvist.janne@gmail.com
Mon May 14 21:12:00 GMT 2007


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.

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. I see that I 
presented the other side of the coin when commenting  on the original 
patch ( http://gcc.gnu.org/ml/fortran/2005-12/msg00132.html ), but IIRC 
Thomas convinced me on IRC.

However, with your patch portability for unformatted files is increased 
ever so slightly, since padding is included regardless of whether endian 
conversion was used or not (with the caveat that other platforms may pad 
differently, as I mentioned in my email linked above). Additionally 
taking into account that it does fix a bug, I guess it's ok for trunk 
(with the comment fixes). Wait for a week or so before committing to the 
4.2 branch to give people on non-Linux/x86 platforms time to test.

--
Janne



More information about the Gcc-patches mailing list