https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102901
Bug ID: 102901 Summary: ICE (segfault) when compiling pdt_13.f03 with -fcheck=all in gfc_check_pdt_dummy -> structure_alloc_comps Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org Target Milestone: --- Existing pdt_13.f03, pdt_14.f03 and pdt_15.f03 fail when compiled with -fcheck=all structure_alloc_comps: 9998 case CHECK_PDT_DUMMY: 9999 10000 comp = fold_build3_loc (input_location, COMPONENT_REF, ctype, 10001 decl, cdecl, NULL_TREE); -> #1 0x0000000000be7ba7 in fold_build3_loc (loc=287456, code=code@entry=COMPONENT_REF, type=type@entry=0x7ffff6fc15e8, op0=op0@entry=0x7ffff66cdd00, op1=op1@entry=0x7ffff719c2f8, op2=op2@entry=0x0) at ../../repos/gcc-trunk-commit/gcc/fold-const.c:13813 13813 tem = fold_ternary_loc (loc, code, type, op0, op1, op2); (gdb) p code $16 = COMPONENT_REF (gdb) p debug_tree(type) Cannot access memory at address 0x7ffffbffecef (gdb) p debug_tree(op0) Cannot access memory at address 0x7ffffbffecef (gdb) p debug_tree(op1) Cannot access memory at address 0x7ffffbffecef (gdb) p debug_tree(op2) Cannot access memory at address 0x7ffffbffecef Going up in the calltree: 10009 tmp = gfc_check_pdt_dummy (c->ts.u.derived, comp, 10010 c->as ? c->as->rank : 0, 10011 pdt_param_list); (gdb) p *c->ts.u.derived $19 = {name = 0x7ffff716ee10 "Pdtlink_8", module = 0x7ffff716ede0 "link_module" (gdb) p c->as $20 = (gfc_array_spec *) 0x0 (gdb) p pdt_param_list $21 = (gfc_actual_arglist *) 0x2a4b070 (gdb) p *pdt_param_list $22 = {name = 0x7ffff716edf0 "real_kind", label = 0x0, missing_arg_type = BT_UNKNOWN, spec_type = SPEC_EXPLICIT, expr = 0x2acfce0, next = 0x0}