aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/data.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2007-06-18 23:04:28 +0000
committerPaul Thomas <pault@gcc.gnu.org>2007-06-18 23:04:28 +0000
commitd2088bb6d4b1479b20cda33566fe9b2a5d93ef70 (patch)
tree7d45bf1db41df308e809b253c3da9adb9df0e104 /gcc/fortran/data.c
parent80dcd3aa9b5758de4ac34c687d71e1457e45e572 (diff)
downloadgcc-d2088bb6d4b1479b20cda33566fe9b2a5d93ef70.zip
gcc-d2088bb6d4b1479b20cda33566fe9b2a5d93ef70.tar.gz
gcc-d2088bb6d4b1479b20cda33566fe9b2a5d93ef70.tar.bz2
re PR fortran/20863 ([4.2 only] Pointer problems in PURE procedures)
2007-06-19 Paul Thomas <pault@gcc.gnu.org> PR fortran/20863 PR fortran/20082 * resolve.c (resolve_code): Use gfc_impure_variable as a condition for rejecting derived types with pointers, in pure procedures. (gfc_impure_variable): Add test for dummy arguments of pure procedures; any for functions and INTENT_IN for subroutines. PR fortran/32236 * data.c (gfc_assign_data_value): Change the ICE on an array reference initializer not being an array into an error and clear init to prevent a repetition of the error. 2007-06-19 Paul Thomas <pault@gcc.gnu.org> PR fortran/20863 PR fortran/20082 * gfortran.dg/impure_assignment_2.f90 : New test. PR fortran/32236 * gfortran.dg/data_initialized_2.f90 : New test. * gfortran.dg/equiv_7.f90 : Test for endianess and call the appropriate version of 'dmach'. From-SVN: r125831
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);