https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91588
Bug ID: 91588
Summary: ICE in check_inquiry, at fortran/expr.c:2673
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
Also an old issue, ICEs down to at least gfortran-5.
Starting with something legal :
$ cat z0.f90
program p
character(4) :: z = '1234'
block
integer(len(z)) :: a
print *, kind(a)
end block
end
$ gfortran-10-20190825 z0.f90 && ./a.out
4
Corresponding :
$ cat z1.f90
program p
associate (z => '1234')
block
integer(len(z)) :: a
print *, kind(a)
end block
end associate
end
$ gfortran-10-20190825 -c z1.f90
f951: internal compiler error: Segmentation fault
0xb3acef crash_signal
../../gcc/toplev.c:326
0x61ed54 check_inquiry
../../gcc/fortran/expr.c:2673
0x61f390 check_inquiry
../../gcc/fortran/expr.c:2615
0x61f390 gfc_check_init_expr(gfc_expr*)
../../gcc/fortran/expr.c:2868
0x61f4e7 gfc_reduce_init_expr(gfc_expr*)
../../gcc/fortran/expr.c:3039
0x622660 gfc_match_init_expr(gfc_expr**)
../../gcc/fortran/expr.c:3085
0x605795 gfc_match_kind_spec(gfc_typespec*, bool)
../../gcc/fortran/decl.c:3049
0x60becd gfc_match_decl_type_spec(gfc_typespec*, int)
../../gcc/fortran/decl.c:4431
0x60d59c gfc_match_data_decl()
../../gcc/fortran/decl.c:5986
0x66e5b3 match_word
../../gcc/fortran/parse.c:65
0x66e5b3 decode_statement
../../gcc/fortran/parse.c:376
0x67006a next_free
../../gcc/fortran/parse.c:1241
0x67006a next_statement
../../gcc/fortran/parse.c:1473
0x6723d4 parse_spec
../../gcc/fortran/parse.c:3681
0x67411c parse_progunit
../../gcc/fortran/parse.c:5680
0x6734f2 parse_block_construct
../../gcc/fortran/parse.c:4492
0x6734f2 parse_executable
../../gcc/fortran/parse.c:5321
0x673761 parse_associate
../../gcc/fortran/parse.c:4630
0x673761 parse_executable
../../gcc/fortran/parse.c:5325
0x6741bf parse_progunit
../../gcc/fortran/parse.c:5706