* [patch, fortran] PR32710 - ICE: namelist and subroutine with the same name
@ 2007-07-22 15:04 Daniel Franke
2007-07-22 16:32 ` Jerry DeLisle
0 siblings, 1 reply; 2+ messages in thread
From: Daniel Franke @ 2007-07-22 15:04 UTC (permalink / raw)
To: fortran; +Cc: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 406 bytes --]
: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
[-- Attachment #2: pr32710.patch --]
[-- Type: text/x-diff, Size: 1086 bytes --]
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch, fortran] PR32710 - ICE: namelist and subroutine with the same name
2007-07-22 15:04 [patch, fortran] PR32710 - ICE: namelist and subroutine with the same name Daniel Franke
@ 2007-07-22 16:32 ` Jerry DeLisle
0 siblings, 0 replies; 2+ messages in thread
From: Jerry DeLisle @ 2007-07-22 16:32 UTC (permalink / raw)
To: Daniel Franke; +Cc: fortran, gcc-patches
Daniel Franke wrote:
> :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
>
OK
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-07-22 15:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-22 15:04 [patch, fortran] PR32710 - ICE: namelist and subroutine with the same name Daniel Franke
2007-07-22 16:32 ` Jerry DeLisle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).