This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [patch, libgfortran] PR 31915 - fix reading/writing of real(10) variables with convert="SWAP"
- From: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, "'fortran at gcc dot gnu dot org'" <fortran at gcc dot gnu dot org>
- Date: Tue, 15 May 2007 00:12:17 +0300
- Subject: Re: [patch, libgfortran] PR 31915 - fix reading/writing of real(10) variables with convert="SWAP"
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=P/0eqMO3mLXTYd+DUFgydWks4qvsKkQPrUJHZwZXdcqE3EBYKnyUX1b7AfhGaJgffjXQUPu7gH/RIFXitReXKaG3906ra4xhQuE44qRJ9XXKItm4WmgLVGNVVT0eRYVlz+MOwe9u0bOy2wG9PZ/qrNMaIaZesB5jwstAcus9A60=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=G9O33hXB+uR/SBZYo20UsiQwi+1fspdwQfrAGKgO+PEosSIOYZQ8qwZZXzFQIDbI/NpIWRJrVNY0ZGfHuMMT65fbmOL6ntiy6iV0cvBQK2eZ+9LTUHBLtizyHUJgYs2YF2coIEtanQPLXF2Iy0wgwB2n9ZKx9jHZLr6wmqh4LiU=
- References: <4648C361.6030909@net-b.de> <4648C660.5060907@net-b.de>
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