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

            Bug ID: 91649
           Summary: ICE in gfc_resolve_findloc, at fortran/iresolve.c:1827
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

The ICE slipped in between 20181021 and 20181028 :


$ cat z1.f90
program p
   logical :: back = .true.
   integer :: x(1) = findloc([1, 2, 1], '1', back=back)
   print *, x
end


$ cat z2.f90
program p
   type t
   end type
   logical :: back = .false.
   integer :: x(1) = findloc([1, 2, 1], t(), back=back)
   print *, x
end


$ cat z3.f90
program p
   character(4) :: c = '1234'
   integer :: x(1) = findloc([1, 2, 1], c, back=.true.)
   print *, x
end


$ gfortran-10-20190901 -c z1.f90
z1.f90:3:40:

    3 |    integer :: x(1) = findloc([1, 2, 1], '1', back=back)
      |                                        1
internal compiler error: Cannot convert 'CHARACTER(1)' to 'INTEGER(4)' at (1)
0x61c001 gfc_internal_error(char const*, ...)
        ../../gcc/fortran/error.c:1363
0x63aa36 gfc_convert_type_warn(gfc_expr*, gfc_typespec*, int, int)
        ../../gcc/fortran/intrinsic.c:5241
0x64600a gfc_resolve_findloc(gfc_expr*, gfc_expr*, gfc_expr*, gfc_expr*,
gfc_expr*, gfc_expr*, gfc_expr*)
        ../../gcc/fortran/iresolve.c:1827
0x62f99d resolve_intrinsic
        ../../gcc/fortran/intrinsic.c:4477
0x62f99d do_simplify
        ../../gcc/fortran/intrinsic.c:4596
0x639fde gfc_intrinsic_func_interface(gfc_expr*, int)
        ../../gcc/fortran/intrinsic.c:4941
0x6916e1 resolve_unknown_f
        ../../gcc/fortran/resolve.c:2896
0x6916e1 resolve_function
        ../../gcc/fortran/resolve.c:3233
0x68db05 gfc_resolve_expr(gfc_expr*)
        ../../gcc/fortran/resolve.c:6954
0x61fe84 gfc_reduce_init_expr(gfc_expr*)
        ../../gcc/fortran/expr.c:3037
0x623030 gfc_match_init_expr(gfc_expr**)
        ../../gcc/fortran/expr.c:3085
0x60f2a2 variable_decl
        ../../gcc/fortran/decl.c:2835
0x60f2a2 gfc_match_data_decl()
        ../../gcc/fortran/decl.c:6062
0x66f983 match_word
        ../../gcc/fortran/parse.c:65
0x66f983 decode_statement
        ../../gcc/fortran/parse.c:376
0x6713ca next_free
        ../../gcc/fortran/parse.c:1251
0x6713ca next_statement
        ../../gcc/fortran/parse.c:1483
0x6729eb parse_spec
        ../../gcc/fortran/parse.c:3881
0x6757dc parse_progunit
        ../../gcc/fortran/parse.c:5799
0x676ea9 gfc_parse_file()
        ../../gcc/fortran/parse.c:6339

Reply via email to