From ec552c237d20063c191d1951c0eea0393bafb9ee Mon Sep 17 00:00:00 2001 From: pault Date: Tue, 4 Nov 2008 21:17:53 +0000 Subject: [PATCH] 2008-11-04 Paul Thomas PR fortran/37597 * parse.c (gfc_fixup_sibling_symbols ): Fixup contained, even when symbol not found. 2008-11-04 Paul Thomas PR fortran/37597 * gfortran.dg/host_assoc_call_5.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141588 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/parse.c | 3 ++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/host_assoc_call_5.f90 | 21 +++++++++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.dg/host_assoc_call_5.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index ec83b16b59c..c5abefaaee6 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2008-11-04 Paul Thomas + + PR fortran/37597 + * parse.c (gfc_fixup_sibling_symbols ): Fixup contained, even + when symbol not found. + 2008-11-03 Tobias Burnus PR fortran/37821 diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index a96f77d8416..e52c06f0a5a 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -3313,7 +3313,7 @@ gfc_fixup_sibling_symbols (gfc_symbol *sym, gfc_namespace *siblings) gfc_find_sym_tree (sym->name, ns, 0, &st); if (!st || (st->n.sym->attr.dummy && ns == st->n.sym->ns)) - continue; + goto fixup_contained; old_sym = st->n.sym; if (old_sym->ns == ns @@ -3347,6 +3347,7 @@ gfc_fixup_sibling_symbols (gfc_symbol *sym, gfc_namespace *siblings) gfc_free_symbol (old_sym); } +fixup_contained: /* Do the same for any contained procedures. */ gfc_fixup_sibling_symbols (sym, ns->contained); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b2dfc5927d2..41c76e4dd28 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-11-04 Paul Thomas + + PR fortran/37597 + * gfortran.dg/host_assoc_call_5.f90: New test. + 2008-11-04 Jakub Jelinek Andrew Pinski diff --git a/gcc/testsuite/gfortran.dg/host_assoc_call_5.f90 b/gcc/testsuite/gfortran.dg/host_assoc_call_5.f90 new file mode 100644 index 00000000000..6ce57ce0190 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/host_assoc_call_5.f90 @@ -0,0 +1,21 @@ +! { dg-do compile } +! Tests the fix for PR37597, where the reference to other_sub would generate +! Error: Symbol 'other_sub' at (1) has no IMPLICIT type. +! +! Contributed by Tobias Burnus +! from a report on clf by Rich Townsend +! +module foo + implicit none +contains + subroutine main_sub () + call internal_sub() + contains + subroutine internal_sub() + call QAG(other_sub) + end subroutine internal_sub + end subroutine main_sub + subroutine other_sub () + end subroutine other_sub +end module foo +! { dg-final { cleanup-modules "foo" } } -- 2.11.4.GIT