[Bug fortran/58270] Wrong code while accessing array elements in a global structure
dominiq at lps dot ens.fr
gcc-bugzilla@gcc.gnu.org
Mon Sep 2 12:21:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58270
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #13 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Example of failing FORTRAN code, with assembler output from gfortran 4.6.4
This code is invalid:
5.7.2.5 Differences between named common and blank common
A blank common block has the same properties as a named common block, except
for the following.
...
Named common blocks of the same name shall be of the same size in all scoping
units of a program in which they appear, but blank common blocks may be of
di
erent sizes.
...
If you put the two *.f files in the same one and compile the result, you get
the following waring:
Warning: Named COMMON block 'mem' at (1) shall be of the same size as elsewhere
(24 vs 8 bytes)
and the executable gives the result you expect.
More information about the Gcc-bugs
mailing list