re PR fortran/32710 (ICE: namelist and subroutine with the same name)

gcc/fortran:
2007-07-22  Daniel Franke  <franke.daniel@gmail.com>

	PR fortran/32710
	* parse.c (gfc_fixup_sibling_symbols): No replacement of symbols if
	the current is a namelist.

gcc/testsuite:
2007-07-22  Daniel Franke  <franke.daniel@gmail.com>

	PR fortran/32710
	* gfortran.dg/namelist_30.f90: New test.

From-SVN: r126828
This commit is contained in:
Daniel Franke 2007-07-22 12:37:12 -04:00 committed by Daniel Franke
parent 26677eb88e
commit eec14ce5ec
4 changed files with 32 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2007-07-22 Daniel Franke <franke.daniel@gmail.com>
PR fortran/32710
* parse.c (gfc_fixup_sibling_symbols): No replacement of symbols if
the current is a namelist.
2007-07-22 Daniel Franke <franke.daniel@gmail.com>
PR fortran/29962

View File

@ -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;

View File

@ -1,3 +1,8 @@
2007-07-22 Daniel Franke <franke.daniel@gmail.com>
PR fortran/32710
* gfortran.dg/namelist_30.f90: New test.
2007-07-22 Daniel Franke <franke.daniel@gmail.com>
PR fortran/29962

View File

@ -0,0 +1,19 @@
! { dg-do compile }
!
! PR fortran/32710 - ICE: namelist and subroutine with the same name
!
! Contributed by Janus Weil <jaydub66 AT gmail DOT com>
!
program x
contains
subroutine readInput
integer:: a
NAMELIST /foo/ a
read(5,nml=foo)
end subroutine readInput
subroutine foo()
end subroutine
end program