aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/data.c')
-rw-r--r--gcc/fortran/data.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/fortran/data.c b/gcc/fortran/data.c
index 75e4241..35213a8 100644
--- a/gcc/fortran/data.c
+++ b/gcc/fortran/data.c
@@ -288,6 +288,15 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index)
switch (ref->type)
{
case REF_ARRAY:
+ if (init && expr->expr_type != EXPR_ARRAY)
+ {
+ gfc_error ("'%s' at %L already is initialized at %L",
+ lvalue->symtree->n.sym->name, &lvalue->where,
+ &init->where);
+ gfc_free_expr (init);
+ init = NULL;
+ }
+
if (init == NULL)
{
/* The element typespec will be the same as the array
@@ -297,8 +306,6 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index)
expr->expr_type = EXPR_ARRAY;
expr->rank = ref->u.ar.as->rank;
}
- else
- gcc_assert (expr->expr_type == EXPR_ARRAY);
if (ref->u.ar.type == AR_ELEMENT)
get_array_index (&ref->u.ar, &offset);