PR fortran/16861
* resolve.c (resolve_variable): If e->symtree is not set, this
ought to be a FAILURE, and not a segfault.
* gfortran.dg/pr16861.f90: New test.
From-SVN: r98391
+2005-04-19 Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+ PR fortran/16861
+ * resolve.c (resolve_variable): If e->symtree is not set, this
+ ought to be a FAILURE, and not a segfault.
+
2005-04-17 Paul Thomas <pault@gcc.gnu.org>
PR fortran/17472
if (e->ref && resolve_ref (e) == FAILURE)
return FAILURE;
+ if (e->symtree == NULL)
+ return FAILURE;
+
sym = e->symtree->n.sym;
if (sym->attr.flavor == FL_PROCEDURE && !sym->attr.function)
{
+2005-04-18 Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+ PR fortran/16861
+ * gfortran.dg/pr16861.f90: New test.
+
2005-04-18 James A. Morrison <phython@gcc.gnu.org>
* gcc.dg/pr21085.c: New test.
--- /dev/null
+! PR fortran/16861
+! { dg-do run }
+module foo
+ integer :: i
+end module foo
+
+module bar
+contains
+ subroutine baz(j)
+ use foo
+ integer, dimension(i) :: j
+ integer :: n
+
+ do n = 1, i
+ if (j(n) /= n**2) call abort
+ end do
+ end subroutine baz
+end module bar
+
+subroutine quus()
+ use foo
+ use bar
+
+ i = 2
+ call baz ((/1,4/))
+ i = 7
+ call baz ((/1,4,9,16,25,36,49/))
+end subroutine quus
+
+program test
+ call quus
+end program test