Commit 25e8cb2e by Paul Thomas

[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
parent 9e826585
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> 2006-10-04 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29098 PR fortran/29098
......
...@@ -3466,7 +3466,7 @@ resolve_allocate_expr (gfc_expr * e, gfc_code * code) ...@@ -3466,7 +3466,7 @@ resolve_allocate_expr (gfc_expr * e, gfc_code * code)
pointer = e->symtree->n.sym->attr.pointer; pointer = e->symtree->n.sym->attr.pointer;
dimension = e->symtree->n.sym->attr.dimension; 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 " gfc_error ("The STAT variable '%s' in an ALLOCATE statement must "
"not be allocated in the same statement at %L", "not be allocated in the same statement at %L",
...@@ -3571,6 +3571,11 @@ check_symbols: ...@@ -3571,6 +3571,11 @@ check_symbols:
for (a = code->ext.alloc_list; a; a = a->next) for (a = code->ext.alloc_list; a; a = a->next)
{ {
sym = a->expr->symtree->n.sym; 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])) 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]))) || (ar->end[i] != NULL && find_sym_in_expr (sym, ar->end[i])))
{ {
......
2006-10-04 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29343
* gfortran.dg/alloc_alloc_expr_2.f90: New test.
2006-10-04 Francois-Xavier Coudert <coudert@clipper.ens.fr> 2006-10-04 Francois-Xavier Coudert <coudert@clipper.ens.fr>
* gfortran.dg/bounds_check_fail_1.f90: New test. * gfortran.dg/bounds_check_fail_1.f90: New test.
! { dg-do compile }
! This tests the fix for PR29343, in which the valid ALLOCATE statement
! below triggered an error following the patch for PR20779 and PR20891.
!
! Contributed by Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
!
Subroutine ReadParameters (Album)
Implicit NONE
Type GalleryP
Integer :: NoOfEntries
Character(80), Pointer :: FileName (:)
End Type GalleryP
Type(GalleryP), Intent(Out) :: Album
Allocate (Album%FileName (Album%NoOfEntries))
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment