OSDN Git Service

2007-11-25 Jerry DeLisle <jvdelisle@gcc.gnu.org>
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 25 Nov 2007 22:12:19 +0000 (22:12 +0000)
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 25 Nov 2007 22:12:19 +0000 (22:12 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130415 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/decl.c
gcc/fortran/match.c
gcc/fortran/resolve.c

index 2b4799a..f43d26a 100644 (file)
@@ -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
index ca17829..d607435 100644 (file)
@@ -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.  */
index 83b8873..f769651 100644 (file)
@@ -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;
 
index c6808eb..0fe5d32 100644 (file)
@@ -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);