This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/66141] Invalid code generation with -O1, -O2, -O3 for x86_64 target for array reference in Fortran COMMON
- From: "dominiq at lps dot ens.fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 14 May 2015 10:03:49 +0000
- Subject: [Bug fortran/66141] Invalid code generation with -O1, -O2, -O3 for x86_64 target for array reference in Fortran COMMON
- Auto-submitted: auto-generated
- References: <bug-66141-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66141
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |DUPLICATE
--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> [Program generates warning on compilation, but this is allowed under
> the semantics of Fortran COMMON (allocated COMMON storage is longest
> among any of its definition).]
Nope! see the second item below:
5.7.2.5 Dierences between named common and blank common
1 A blank common block has the same properties as a named common block,
except for the following.
Execution of a RETURN or END statement might cause data objects in a named
common block to become undefined unless the common block has the SAVE
attribute,
but never causes data objects in blank common to become undefined (16.6.6).
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
different sizes.
A data object in a named common block may be initially defined by means of
a DATA statement or type declaration statement in a block data program unit
(11.3), but objects in blank common shall not be initially defined.
*** This bug has been marked as a duplicate of bug 53086 ***