re PR fortran/18525 (ICE on valid code in gfc_get_symbol_decl())

fortran/
* dump-parse-tree.c (gfc_show_expr): Dump name of namespace
in which the variable is declared.

PR fortran/18525
* resolve.c (was_declared): Also check for dummy attribute.

testsuite/
PR fortran/18525
* gfortran.dg/nesting_1.f90: New test.

From-SVN: r96739
This commit is contained in:
Tobias Schlüter 2005-03-19 20:45:45 +01:00
parent 0de27aacb6
commit 9439ae414f
5 changed files with 34 additions and 1 deletions

View File

@ -1,3 +1,11 @@
2005-03-18 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
* dump-parse-tree.c (gfc_show_expr): Dump name of namespace
in which the variable is declared.
PR fortran/18525
* resolve.c (was_declared): Also check for dummy attribute.
2005-03-18 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
* gfortran.h (arith): Remove ARITH_0TO0.

View File

@ -409,6 +409,8 @@ gfc_show_expr (gfc_expr * p)
break;
case EXPR_VARIABLE:
if (p->symtree->n.sym->ns && p->symtree->n.sym->ns->proc_name)
gfc_status ("%s:", p->symtree->n.sym->ns->proc_name->name);
gfc_status ("%s", p->symtree->n.sym->name);
gfc_show_ref (p->ref);
break;

View File

@ -481,7 +481,7 @@ was_declared (gfc_symbol * sym)
if (!a.implicit_type && sym->ts.type != BT_UNKNOWN)
return 1;
if (a.allocatable || a.dimension || a.external || a.intrinsic
if (a.allocatable || a.dimension || a.dummy || a.external || a.intrinsic
|| a.optional || a.pointer || a.save || a.target
|| a.access != ACCESS_UNKNOWN || a.intent != INTENT_UNKNOWN)
return 1;

View File

@ -1,3 +1,8 @@
2005-03-19 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/18525
* gfortran.dg/nesting_1.f90: New test.
2005-03-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/20240

View File

@ -0,0 +1,18 @@
! PR 18525
! we used to incorrectly refer to n from a when resolving the call to
! c from b
! { dg-do run }
subroutine a(n)
call b(n+1)
contains
subroutine b(n)
call c(n)
end subroutine b
subroutine c(m)
if (m/=1) call abort
end subroutine c
end subroutine a
call a(0)
end