aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2006-10-04 16:54:19 +0000
committerPaul Thomas <pault@gcc.gnu.org>2006-10-04 16:54:19 +0000
commit25e8cb2e47725fcc67f4cbbf85c37bee47bcc1d0 (patch)
tree52b27ca1efc8544a6b827ef97e820a40041b824f /gcc/fortran/resolve.c
parent9e8265851df1859e0dfc447cb9ac44088bb8cb1c (diff)
downloadgcc-25e8cb2e47725fcc67f4cbbf85c37bee47bcc1d0.zip
gcc-25e8cb2e47725fcc67f4cbbf85c37bee47bcc1d0.tar.gz
gcc-25e8cb2e47725fcc67f4cbbf85c37bee47bcc1d0.tar.bz2
[multiple changes]
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/29343 * gfortran.dg/alloc_alloc_expr_2.f90: New test. From-SVN: r117435
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c7
1 files changed, 6 insertions, 1 deletions
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])))
{