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

            Bug ID: 95979
           Summary: [10/11 Regression] ICE in get_kind, at
                    fortran/simplify.c:129
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

Changed between 20191215 and 20200105 :


$ cat z1.f90
program p
   integer :: a = index('abcd', 'c', [.true.], kind=1)
end


$ cat z2.f90
program p
   integer :: a = index('abcd', 'c', [.true.], kind=4)
end


$ cat z3.f90
program p
   integer :: a(1) = index('abcd', 'c', [.true.])
   integer :: b(1) = index('abcd', 'c', [.true.], kind=1)
   print *, a
   print *, b
end


$ gfortran-10-20191215 -c z1.f90
z1.f90:2:15:

    2 |    integer :: a = index('abcd', 'c', [.true.], kind=1)
      |               1
Error: Incompatible ranks 0 and 1 in assignment at (1)


$ gfortran-11-20200628 -c z1.f90
0xbd215f crash_signal
        ../../gcc/toplev.c:328
0x65730f gfc_format_decoder
        ../../gcc/fortran/error.c:981
0x1504fce pp_format(pretty_printer*, text_info*)
        ../../gcc/pretty-print.c:1475
0x14f96df diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
        ../../gcc/diagnostic.c:1159
0x657489 gfc_report_diagnostic
        ../../gcc/fortran/error.c:782
0x65759b gfc_error_opt
        ../../gcc/fortran/error.c:1352
0x658aa0 gfc_error(char const*, ...)
        ../../gcc/fortran/error.c:1381
0x6db27a get_kind
        ../../gcc/fortran/simplify.c:129
0x6e4ce1 gfc_simplify_index(gfc_expr*, gfc_expr*, gfc_expr*, gfc_expr*)
        ../../gcc/fortran/simplify.c:3479
0x66c997 do_simplify
        ../../gcc/fortran/intrinsic.c:4634
0x677178 gfc_intrinsic_func_interface(gfc_expr*, int)
        ../../gcc/fortran/intrinsic.c:4899
0x65d5f9 gfc_simplify_expr(gfc_expr*, int)
        ../../gcc/fortran/expr.c:2180
0x65e03a scalarize_intrinsic_call
        ../../gcc/fortran/expr.c:2422
0x65c82b gfc_check_init_expr(gfc_expr*)
        ../../gcc/fortran/expr.c:2934
0x65cb07 gfc_reduce_init_expr(gfc_expr*)
        ../../gcc/fortran/expr.c:3087
0x65fd70 gfc_match_init_expr(gfc_expr**)
        ../../gcc/fortran/expr.c:3133
0x64b5f4 variable_decl
        ../../gcc/fortran/decl.c:2886
0x64b5f4 gfc_match_data_decl()
        ../../gcc/fortran/decl.c:6197
0x6ae0a3 match_word
        ../../gcc/fortran/parse.c:65
0x6ae0a3 decode_statement
        ../../gcc/fortran/parse.c:376

Reply via email to