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

            Bug ID: 85781
           Summary: ICE in gfc_build_array_ref, at fortran/trans.c:393
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

Affects also versions down to at least 4.8 :

$ cat z1.f90
subroutine s(x) bind(c)
   use iso_c_binding, only: c_char
   character(kind=c_char), value :: x
   print *, x(2:1)
end


$ gfortran-9-20180513 -c z1.f90
z1.f90:4:0:

    print *, x(2:1)

internal compiler error: in gfc_build_array_ref, at fortran/trans.c:393
0x74c15b gfc_build_array_ref(tree_node*, tree_node*, tree_node*, tree_node*)
        ../../gcc/fortran/trans.c:393
0x7821e5 gfc_conv_substring
        ../../gcc/fortran/trans-expr.c:2301
0x782524 gfc_conv_variable
        ../../gcc/fortran/trans-expr.c:2766
0x77f312 gfc_conv_expr(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-expr.c:7930
0x785bba gfc_conv_expr_reference(gfc_se*, gfc_expr*)
        ../../gcc/fortran/trans-expr.c:8022
0x7a5d76 gfc_trans_transfer(gfc_code*)
        ../../gcc/fortran/trans-io.c:2585
0x74b647 trans_code
        ../../gcc/fortran/trans.c:2044
0x7a3827 build_dt
        ../../gcc/fortran/trans-io.c:2027
0x74b667 trans_code
        ../../gcc/fortran/trans.c:2016
0x772c49 gfc_generate_function_code(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:6507
0x701d40 translate_all_program_units
        ../../gcc/fortran/parse.c:6121
0x701d40 gfc_parse_file()
        ../../gcc/fortran/parse.c:6324
0x748adf gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:204

Reply via email to