This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[patch, fortran] PR32710 - ICE: namelist and subroutine with the same name
- From: Daniel Franke <franke dot daniel at gmail dot com>
- To: fortran at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 22 Jul 2007 11:17:23 +0200
- Subject: [patch, fortran] PR32710 - ICE: namelist and subroutine with the same name
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:from:to:subject:date:user-agent:cc:mime-version:content-type:message-id; b=ce15Ir5LCjr27JSKBLmKjzBOJ47X5CgltJoH50PO/afEHUDYekYdAFpWg8rnSaQF7sP5Ternypw9sfob1B4zt1lPd7HJJfWy3B73RRIfiigU8ztZH5N0EmbPVRz1SBp20iIoJzZGVzibAf75lt59yfL/i2OZJ07BKAFLsCQOQYc=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:from:to:subject:date:user-agent:cc:mime-version:content-type:message-id; b=ZjPG7o6jCHkmhSJtD5fhG2lB9xdnu2r3nw5RyJ1BVY1w9P9UrikYCZyJ5YxWhKg/XpnwbZuXzaIaqG14D0KBUMx1lo2nFGkJwxNmq6HuGEPGqz7X+hPM4RrDXFprDXKe+HD3tRV+NaL3cBHKCCrsn2vK8auXTHr5N35KfM62mQg=
:ADDPATCH fortran:
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.
Regression tested on i686-pc-linux-gnu. Ok for trunk?
Regards
Daniel
Index: fortran/parse.c
===================================================================
--- fortran/parse.c (revision 126788)
+++ fortran/parse.c (working copy)
@@ -2769,7 +2769,8 @@
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;
Index: testsuite/gfortran.dg/namelist_30.f90
===================================================================
--- testsuite/gfortran.dg/namelist_30.f90 (revision 0)
+++ testsuite/gfortran.dg/namelist_30.f90 (revision 0)
@@ -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