COMMON requires 4 bytes of padding at start
Tobias Schlüter
Tobias.Schlueter@physik.uni-muenchen.de
Fri Sep 12 10:31:00 GMT 2008
Hi Janus,
Janus Weil wrote:
>> d) Action items: I suggest
>> (i) To add an option to optionally do no padding [for COMMON] and enable
>> that option by default (I think we can ignore SEQUENCE)
>
> Here is a patch which changes the default behaviour, so that no
> padding is done in COMMON blocks. In addition a flag -falign-commons
> is introduced, which restores the old behaviour (i.e. automatic
> padding).
>
> With this patch one gets the expected output "2 3" for Tobias' test
> case when omitting -falign-commons. Including the flag gives the old
> output "0 2".
>
> Testing for regressions now.
there are platforms where the padding is required, as unaligned accesses
to, say, real*8 are forbidden. I believe Sparc is one of them. On such
platforms this can't be made the default.
In general, I think we should strive for compatibility with g77 by
default. People have been using C structures to interoperate with
COMMONs for a long while, we should try not to break their code.
Cheers,
- Tobi
More information about the Fortran
mailing list