aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2007-11-25 22:12:19 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2007-11-25 22:12:19 +0000
commitf1607c0199cf4c62a27a73d580e5bc25eb46e6ef (patch)
tree9cf8bd0129df397f429356cb278234f8fd226202 /gcc
parentbfd61955ce652ec1c4bb1228fcf43e46424ebf41 (diff)
downloadgcc-f1607c0199cf4c62a27a73d580e5bc25eb46e6ef.zip
gcc-f1607c0199cf4c62a27a73d580e5bc25eb46e6ef.tar.gz
gcc-f1607c0199cf4c62a27a73d580e5bc25eb46e6ef.tar.bz2
re PR fortran/33152 (Initialization/declaration problems in block data)
2007-11-25 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/33152 * decl.c (add_init_expr_to_sym): Remove error message. * resolve.c (check_data_variable): Add new check for a data variable that has an array spec, but no ref and issue an error. * match.c (gfc_match_common): Remove error message. From-SVN: r130415
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog8
-rw-r--r--gcc/fortran/decl.c9
-rw-r--r--gcc/fortran/match.c15
-rw-r--r--gcc/fortran/resolve.c7
4 files changed, 15 insertions, 24 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 2b4799a..f43d26a 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,11 @@
+2007-11-25 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/33152
+ * decl.c (add_init_expr_to_sym): Remove error message.
+ * resolve.c (check_data_variable): Add new check for a data variable
+ that has an array spec, but no ref and issue an error.
+ * match.c (gfc_match_common): Remove error message.
+
2007-11-25 Tobias Burnus <burnus@net-b.de>
PR fortran/34079
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index ca17829..d607435 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -1176,15 +1176,6 @@ add_init_expr_to_sym (const char *name, gfc_expr **initp, locus *var_locus)
return FAILURE;
}
- if (attr.in_common
- && !attr.data
- && *initp != NULL)
- {
- gfc_error ("Initializer not allowed for COMMON variable '%s' at %C",
- sym->name);
- return FAILURE;
- }
-
if (init == NULL)
{
/* An initializer is required for PARAMETER declarations. */
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 83b8873..f769651 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -2783,21 +2783,6 @@ gfc_match_common (void)
goto cleanup;
}
- if (gfc_add_in_common (&sym->attr, sym->name, NULL) == FAILURE)
- goto cleanup;
-
- if (sym->value != NULL && sym->value->expr_type != EXPR_NULL
- && (name[0] == '\0' || !sym->attr.data))
- {
- if (name[0] == '\0')
- gfc_error ("Previously initialized symbol '%s' in "
- "blank COMMON block at %C", sym->name);
- else
- gfc_error ("Previously initialized symbol '%s' in "
- "COMMON block '%s' at %C", sym->name, name);
- goto cleanup;
- }
-
if (gfc_add_in_common (&sym->attr, sym->name, NULL) == FAILURE)
goto cleanup;
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index c6808eb..0fe5d32 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -8010,6 +8010,13 @@ check_data_variable (gfc_data_variable *var, locus *where)
e->symtree->n.sym->name, &e->symtree->n.sym->declared_at);
}
+ if (e->ref == NULL && e->symtree->n.sym->as)
+ {
+ gfc_error ("DATA array '%s' at %L must be specified in a previous"
+ " declaration", e->symtree->n.sym->name, where);
+ return FAILURE;
+ }
+
if (e->rank == 0)
{
mpz_init_set_ui (size, 1);