This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/29537] ICE in gfc_match_common for blank common in BLOCK DATA unit
- From: "aldot at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Oct 2006 11:36:13 -0000
- Subject: [Bug fortran/29537] ICE in gfc_match_common for blank common in BLOCK DATA unit
- References: <bug-29537-11811@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from aldot at gcc dot gnu dot org 2006-10-22 11:36 -------
I think the code in comment #1 is valid.
f95, 5.5.2.4 Differences between named common and blank common
reads:
A blank common block has the same properties as a named common block except
(iii) [...] objects in blank common shall not be initially defined.
11.8 defines BLOCK DATA as
block-data-stmt
[specification-part]
end-block-data-stmt
where [specification-part] lists no further constrained (wrt blank common).
blank-common imposed constraints seem to include
- 5.1 Type decl stmts: [initialization] shall not appear if obj-name is [...]
an object in blank common
So i don't really see why the testcase in Comment #1 is invalid.
I do, however, consider the snippet below to be invalid (initialization seems
forbidden by the above):
Block data "__BLKDT__"
(line-no.)(nest)
1 block data
2 common c
3 data c /1/
4 end !block data
Diagnostic messages: program name(__BLKDT__)
8657-W: "SOURCE.F90", line 3: Element 'c' of blank common block cannot be
initialized.
Procedure information
Lines : 4
Statements : 4
Scoping unit of blockdata : __BLKDT__
Attribute and Cross reference of name
c
|(Class and Type) : variable name, REAL(4)-implicit
|(Attributes) : common-block-object, initialized
|(Declaration) : 2 3
|(Definition) :
|(Reference) :
--
aldot at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code
Summary|ICE in gfc_match_common |ICE in gfc_match_common for
| |blank common in BLOCK DATA
| |unit
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29537