https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106121
Bug ID: 106121
Summary: ICE in gfc_simplify_extends_type_of, at
fortran/simplify.cc:3109
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
Affects versions down to at least r5 :
(missing attribute allocatable or pointer)
$ cat z1.f90
program p
type t
end type
type(t) :: x
class(t) :: y
print *, extends_type_of(x, y)
end
$ cat z2.f90
program p
type t
end type
type(t) :: x
class(t) :: y
stop extends_type_of(x, y)
end
$ gfortran-13-20220626 -c z1.f90
z1.f90:5:16:
5 | class(t) :: y
| 1
Error: CLASS variable 'y' at (1) must be dummy, allocatable or pointer
(null):0: confused by earlier errors, bailing out
$ gfortran-13-20220626 -c z2.f90
f951: internal compiler error: Segmentation fault
0xcd816f crash_signal
../../gcc/toplev.cc:322
0x78d799 gfc_simplify_extends_type_of(gfc_expr*, gfc_expr*)
../../gcc/fortran/simplify.cc:3109
0x70e0b6 do_simplify
../../gcc/fortran/intrinsic.cc:4670
0x718fca gfc_intrinsic_func_interface(gfc_expr*, int)
../../gcc/fortran/intrinsic.cc:5056
0x76db08 resolve_unknown_f
../../gcc/fortran/resolve.cc:2990
0x76db08 resolve_function
../../gcc/fortran/resolve.cc:3347
0x76db08 gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.cc:7187
0x6fdfa4 gfc_reduce_init_expr(gfc_expr*)
../../gcc/fortran/expr.cc:3163
0x72b268 gfc_match_stopcode
../../gcc/fortran/match.cc:3157
0x751af1 match_word
../../gcc/fortran/parse.cc:67
0x75744d decode_statement
../../gcc/fortran/parse.cc:561
0x757a6a next_free
../../gcc/fortran/parse.cc:1397
0x757a6a next_statement
../../gcc/fortran/parse.cc:1629
0x758ffb parse_spec
../../gcc/fortran/parse.cc:4168
0x75c19c parse_progunit
../../gcc/fortran/parse.cc:6210
0x75d861 gfc_parse_file()
../../gcc/fortran/parse.cc:6755
0x7ab3ef gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229