re PR fortran/51605 (internal compiler error gfc_trans_block_construct, at fortran...
authorTobias Burnus <burnus@net-b.de>
Mon, 19 Dec 2011 20:18:18 +0000 (21:18 +0100)
committerTobias Burnus <burnus@gcc.gnu.org>
Mon, 19 Dec 2011 20:18:18 +0000 (21:18 +0100)
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
        * gfortran.dg/block_10.f90: New.

From-SVN: r182497

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

index e5e8e7fe340dff92c924fa2cd82e060464ed8aae..d9a9b430a4215225d0a3fadcb7b5c860472c16cd 100644 (file)
@@ -1,3 +1,9 @@
+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
index 7d91645207b27d4ca2a0afda40489b05b1a3961b..ea1d7736266b74a51f35896331177d1c44853ad0 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 d08c3ad0831aec5ce57a5afd0c04a86f6a1c1027..701fce8a223c6d37670e38347625adc33b9634ad 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