This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/44350] accepts illegal fortran in BLOCK DATA
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 22 Oct 2013 05:56:07 +0000
- Subject: [Bug fortran/44350] accepts illegal fortran in BLOCK DATA
- Auto-submitted: auto-generated
- References: <bug-44350-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44350
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Incomplete draft patch. It probably rejects too much and doesn't permit all
which is listed in comment 1.
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -2629,4 +2629,19 @@ loop:
break;
}
+ else if (gfc_current_state () == COMP_BLOCK_DATA)
+ switch (st)
+ {
+ case ST_ATTR_DECL:
+ case ST_COMMON:
+ case ST_TYPE:
+ case ST_END_BLOCK_DATA:
+ break;
+
+ default:
+ gfc_error ("%s statement is not allowed inside of BLOCK DATA at %C",
+ gfc_ascii_statement (st));
+ reject_statement ();
+ break;
+ }
/* If we find a statement that can not be followed by an IMPLICIT statement