-m(no-)align-double compatible libgfortran
Erik Schnetter
schnetter@cct.lsu.edu
Tue Feb 20 17:48:00 GMT 2007
On Feb 20, 2007, at 11:38:01, Tobias Schlüter wrote:
> Andrew Pinski wrote:
>>> Hi,
>>>
>>> I somehow lost track. It was proposed to make libgfortran again
>>> compatible with malign-double/nomalign-double.
>> That is because there is no way to get it compatible all the time
>> with any of the ABI changing options.
>>> The last email I found was:
>>> http://gcc.gnu.org/ml/fortran/2007-02/msg00047.html
>>>
>>> Did someone actually look at the source code how this is possible
>>> or has
>>> someone filled a PR (I couldn't find one)?
>> Yes someone filed a bug reprot but I closed it right away as
>> invalid as
>> they did not read the docs warning that it changes the ABI.
>> This is a "m"achine specific option which should not be touched in
>> the front-end at all.
>
> I think most of us Fortran people decided to disagree with you.
> There seems to be only one point where this affects the gfortran/
> libgfortran interface, and this can easily be made to work by
> adding padding to a structure, independent of whether the option is
> given or not. IIRC Erik was working on a patch. Erik, have you
> run into obstacles or did the patch go by unnoticed?
I have a patch that works, but Richard Günther didn't like it because
it is not "robust". The patch adds explicit padding, and any future
change to this structure could break things again. He suggested to
add explicit alignment attributes (not to the structure, but to the
code in the compiler which constructs the call to the run time
library), but I don't know how to do that. I asked on this list, but
didn't press once I didn't get an answer.
I think I have to modify the function gfc_add_field_to_struct to do
this. It sets two kinds of alignment to zero, ALIGN and USER_ALIGN.
I believe thatsetting either or both to 4 may do the trick, but I
didn't find the time to try until it works, or grep in other source
code for examples.
Note that this approach guarantees that -malign-double works: The run-
time library is compiled without this flag, and all code that calls
the run-time library is constructed by the compiler in such a way
that the correct alignment is explicitly specified.
-erik
--
Erik Schnetter <schnetter@cct.lsu.edu>
My email is as private as my paper mail. I therefore support encrypting
and signing email messages. Get my PGP key from www.keyserver.net.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070220/50e78ee5/attachment.sig>
More information about the Fortran
mailing list