diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 16d2c1eea4a..1ad6866e3bb 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2007-07-22 Daniel Franke + + PR fortran/32710 + * parse.c (gfc_fixup_sibling_symbols): No replacement of symbols if + the current is a namelist. + 2007-07-22 Daniel Franke PR fortran/29962 diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index df31bcd719b..974f3a255c5 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -2769,7 +2769,8 @@ gfc_fixup_sibling_symbols (gfc_symbol *sym, gfc_namespace *siblings) if ((old_sym->attr.flavor == FL_PROCEDURE || old_sym->ts.type == BT_UNKNOWN) && old_sym->ns == ns - && !old_sym->attr.contained) + && !old_sym->attr.contained + && old_sym->attr.flavor != FL_NAMELIST) { /* Replace it with the symbol from the parent namespace. */ st->n.sym = sym; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f13e9c64cee..17989ace25a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-07-22 Daniel Franke + + PR fortran/32710 + * gfortran.dg/namelist_30.f90: New test. + 2007-07-22 Daniel Franke PR fortran/29962 diff --git a/gcc/testsuite/gfortran.dg/namelist_30.f90 b/gcc/testsuite/gfortran.dg/namelist_30.f90 new file mode 100644 index 00000000000..1e7cb9ed14f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/namelist_30.f90 @@ -0,0 +1,19 @@ +! { dg-do compile } +! +! PR fortran/32710 - ICE: namelist and subroutine with the same name +! +! Contributed by Janus Weil +! + +program x +contains + subroutine readInput + integer:: a + NAMELIST /foo/ a + read(5,nml=foo) + end subroutine readInput + + subroutine foo() + end subroutine + +end program