[Bug fortran/96085] New: ICE in gfc_finish_var_decl, at fortran/trans-decl.c:694

gscfq@t-online.de gcc-bugzilla@gcc.gnu.org
Mon Jul 6 17:58:38 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96085

            Bug ID: 96085
           Summary: ICE in gfc_finish_var_decl, at
                    fortran/trans-decl.c:694
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :


$ cat z1.f90
module m
   integer, parameter :: a = 1
contains
   subroutine s
      assign 2 to a
    2 print *, a
   end
end


$ cat z2.f90
subroutine sub
   integer, parameter :: a = 1
   call s
contains
   subroutine s
      assign 2 to a
    2 print *, a
   end
end


$ gfortran-11-20200705 -c z2.f90   # accepts invalid
z2.f90:5:19:

    6 |       assign 2 to a
      |                   1
Warning: Deleted feature: ASSIGN statement at (1)


$ gfortran-11-20200705 -c z1.f90
z1.f90:5:19:

    5 |       assign 2 to a
      |                   1
Warning: Deleted feature: ASSIGN statement at (1)
z1.f90:5:0:

    5 |       assign 2 to a
      |
internal compiler error: in gfc_finish_var_decl, at fortran/trans-decl.c:694
0x72c269 gfc_finish_var_decl
        ../../gcc/fortran/trans-decl.c:694
0x72b5c1 gfc_get_symbol_decl(gfc_symbol*)
        ../../gcc/fortran/trans-decl.c:1852
0x73a4b8 gfc_conv_variable
        ../../gcc/fortran/trans-expr.c:2735
0x7366ca gfc_conv_expr(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-expr.c:8693
0x775a36 gfc_conv_label_variable(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-stmt.c:80
0x775aac gfc_trans_label_assign(gfc_code*)
        ../../gcc/fortran/trans-stmt.c:104
0x705d97 trans_code
        ../../gcc/fortran/trans.c:1868
0x72f324 gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6840
0x709c49 gfc_generate_module_code(gfc_namespace*)
        ../../gcc/fortran/trans.c:2264
0x6b6901 translate_all_program_units
        ../../gcc/fortran/parse.c:6294
0x6b6901 gfc_parse_file()
        ../../gcc/fortran/parse.c:6546
0x70284f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:212


More information about the Gcc-bugs mailing list