This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/51605] internal compiler error gfc_trans_block_construct, at fortran/trans-stmt.c:984


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51605

--- Comment #12 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-12-19 18:41:24 UTC ---
(In reply to comment #9)
>   subroutine foo
>     BLOCK_NAME: block
>     end block BLOCK_NAME
>   end subroutine foo
>   subroutine BLOCK_NAME()
>   end subroutine BLOCK_NAME

The problem is the call to "gfc_fixup_sibling_symbols" which finds in
"subroutine foo" the symbol "block_name" (FL_LABEL) - and overrides it with the
subroutine (FL_PROCEDURE).

The source code has:
>             /* By 14.6.1.3, host association should be excluded
>                for the following.  */

I think it missed F95's
"(13) The name of a named construct"

Patch:
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]