OSDN Git Service

gcc/fortran:
authordfranke <dfranke@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 22 Jul 2007 16:37:12 +0000 (16:37 +0000)
committerdfranke <dfranke@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 22 Jul 2007 16:37:12 +0000 (16:37 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126828 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/parse.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/namelist_30.f90 [new file with mode: 0644]

index 16d2c1e..1ad6866 100644 (file)
@@ -1,5 +1,11 @@
 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
        PR fortran/31253
        PR fortran/31265
index df31bcd..974f3a2 100644 (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;
index f13e9c6..17989ac 100644 (file)
@@ -1,5 +1,10 @@
 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
        * gfortran.dg/array_initializer_1.f90: Removed warning.
        * gfortran.dg/initialization_1.f90: Adjusted messages.
diff --git a/gcc/testsuite/gfortran.dg/namelist_30.f90 b/gcc/testsuite/gfortran.dg/namelist_30.f90
new file mode 100644 (file)
index 0000000..1e7cb9e
--- /dev/null
@@ -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