OSDN Git Service

2011-12-19 Tobias Burnus <burnus@net-b.de>
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 19 Dec 2011 20:18:18 +0000 (20:18 +0000)
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 19 Dec 2011 20:18:18 +0000 (20:18 +0000)
        PR fortran/51605
        * parse.c (gfc_fixup_sibling_symbols): Regard FL_LABEL as
        local symbol.

2011-12-19  Tobias Burnus  <burnus@net-b.de>

        PR fortran/51605
        * gfortran.dg/block_10.f90: New.

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

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

index e5e8e7f..d9a9b43 100644 (file)
@@ -1,6 +1,12 @@
 2011-12-19  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/51605
+       * parse.c (gfc_fixup_sibling_symbols): Regard FL_LABEL as
+       local symbol.
+
+2011-12-19  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/51605
        * match.c (gfc_match_select_type): Handle
        scalar polymophic coarrays.
        (select_type_set_tmp, ): Ditto; avoid segfault if !class_ok.
index 7d91645..ea1d773 100644 (file)
@@ -3908,6 +3908,7 @@ gfc_fixup_sibling_symbols (gfc_symbol *sym, gfc_namespace *siblings)
                  || old_sym->attr.intrinsic
                  || old_sym->attr.generic
                  || old_sym->attr.flavor == FL_NAMELIST
+                 || old_sym->attr.flavor == FL_LABEL
                  || old_sym->attr.proc == PROC_ST_FUNCTION))
        {
          /* Replace it with the symbol from the parent namespace.  */
index d08c3ad..701fce8 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-19  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/51605
+       * gfortran.dg/block_10.f90: New.
+
 2011-12-19  Jason Merrill  <jason@redhat.com>
 
        PR c++/51553
diff --git a/gcc/testsuite/gfortran.dg/block_10.f90 b/gcc/testsuite/gfortran.dg/block_10.f90
new file mode 100644 (file)
index 0000000..0751f79
--- /dev/null
@@ -0,0 +1,34 @@
+! { dg-do compile }
+!
+! PR fortran/51605
+!
+
+contains
+  subroutine foo
+    BLOCK_NAME: block
+    end block BLOCK_NAME
+  end subroutine foo
+
+  subroutine BLOCK_NAME()
+  end subroutine BLOCK_NAME
+
+  subroutine bar()
+  end subroutine bar
+end
+
+subroutine test()
+contains
+  subroutine BLOCK_NAME()
+  end subroutine BLOCK_NAME
+
+  subroutine foobar()
+  end subroutine foobar
+
+  subroutine foo
+    BLOCK_NAME: block
+    end block BLOCK_NAME
+  end subroutine foo
+
+  subroutine bar()
+  end subroutine bar
+end