diff options
-rw-r--r-- | gcc/fortran/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fortran/match.c | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 1c7742c..fcb03bc 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2007-11-27 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/34227 + * match.c (gfc_match_common): Add additional check for BLOCK DATA. + 2007-11-27 Paul Thomas <pault@gcc.gnu.org> PR fortran/29389 diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index fe2a343..2586dd4 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -2783,6 +2783,16 @@ gfc_match_common (void) goto cleanup; } + if (((sym->value != NULL && sym->value->expr_type != EXPR_NULL) + || sym->attr.data) && gfc_current_state () != COMP_BLOCK_DATA) + { + if (gfc_notify_std (GFC_STD_GNU, "Initialized symbol '%s' at %C " + "can only be COMMON in " + "BLOCK DATA", sym->name) + == FAILURE) + goto cleanup; + } + if (gfc_add_in_common (&sym->attr, sym->name, NULL) == FAILURE) goto cleanup; |