diff options
Diffstat (limited to 'gcc/fortran')
| -rw-r--r-- | gcc/fortran/ChangeLog | 8 | ||||
| -rw-r--r-- | gcc/fortran/resolve.c | 7 |
2 files changed, 14 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 548a3d9..5038694 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2006-10-04 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/29343 + * resolve.c (resolve_allocate_expr): Exclude derived types from + search for dependences between allocated variables and the + specification expressions for other allocations in the same + statement. + 2006-10-04 Paul Thomas <pault@gcc.gnu.org> PR fortran/29098 diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index e28a93c..b9653eb 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -3466,7 +3466,7 @@ resolve_allocate_expr (gfc_expr * e, gfc_code * code) pointer = e->symtree->n.sym->attr.pointer; dimension = e->symtree->n.sym->attr.dimension; - if (sym == e->symtree->n.sym) + if (sym == e->symtree->n.sym && sym->ts.type != BT_DERIVED) { gfc_error ("The STAT variable '%s' in an ALLOCATE statement must " "not be allocated in the same statement at %L", @@ -3571,6 +3571,11 @@ check_symbols: for (a = code->ext.alloc_list; a; a = a->next) { sym = a->expr->symtree->n.sym; + + /* TODO - check derived type components. */ + if (sym->ts.type == BT_DERIVED) + continue; + if ((ar->start[i] != NULL && find_sym_in_expr (sym, ar->start[i])) || (ar->end[i] != NULL && find_sym_in_expr (sym, ar->end[i]))) { |
