https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103139
Bug ID: 103139
Summary: [12 Regression] ICE in fold_convert_loc, at
fold-const.c:2573
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
Changed between 20211017 and 20211024 :
$ cat z1.f90
program p
type t
end type
type, extends(t) :: t2
end type
type t3
class(t), allocatable :: x
end type
type(t2) :: x
call sub (t3(x))
end
$ gfortran-12-20211017 -c z1.f90
z1.f90:10:16:
10 | call sub (t3(x))
| 1
Error: Cannot convert TYPE(t2) to CLASS(__class_p_T_a) at (1)
$ gfortran-12-20211107 -c z1.f90
z1.f90:10:19:
10 | call sub (t3(x))
| 1
internal compiler error: in fold_convert_loc, at fold-const.c:2573
0xa5bdc3 fold_convert_loc(unsigned int, tree_node*, tree_node*)
../../gcc/fold-const.c:2573
0x884807 gfc_trans_subcomponent_assign
../../gcc/fortran/trans-expr.c:8936
0x88513b gfc_trans_structure_assign(tree_node*, gfc_expr*, bool, bool)
../../gcc/fortran/trans-expr.c:9174
0x87d780 gfc_conv_structure(gfc_se*, gfc_expr*, int)
../../gcc/fortran/trans-expr.c:9241
0x87d9bc gfc_conv_expr(gfc_se*, gfc_expr*)
../../gcc/fortran/trans-expr.c:9409
0x8855e2 gfc_conv_expr_reference(gfc_se*, gfc_expr*, bool)
../../gcc/fortran/trans-expr.c:9535
0x88797a gfc_conv_procedure_call(gfc_se*, gfc_symbol*, gfc_actual_arglist*,
gfc_expr*, vec<tree_node*, va_gc, vl_embed>*)
../../gcc/fortran/trans-expr.c:6506
0x8c3db8 gfc_trans_call(gfc_code*, bool, tree_node*, tree_node*, bool)
../../gcc/fortran/trans-stmt.c:424
0x84ce08 trans_code
../../gcc/fortran/trans.c:1984
0x875cfe gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:7666
0x7f920e translate_all_program_units
../../gcc/fortran/parse.c:6629
0x7f920e gfc_parse_file()
../../gcc/fortran/parse.c:6916
0x845d3f gfc_be_parse_file
../../gcc/fortran/f95-lang.c:216