https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97235
Bug ID: 97235 Summary: ICE in duplicate, at ipa-prop.c:4251 Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: asolokha at gmx dot com CC: marxin at gcc dot gnu.org Target Milestone: --- gcc-11.0.0-alpha20200927 snapshot (g:e24817aa7a1c6d12039b486ab5ea9b5ee0a46cd4) ICEs when compiling the following testcase w/ -O2 -fno-ipa-modref: struct ie { int hk; }; typedef int gn (int, struct ie *); int de (int, struct ie *); int qc (int, struct ie *); int bh; int uj (gn yz) { struct ie *se = 0; if (se->hk == 1) return yz (bh, se); return 1; } int n6 (void) { (void) uj (qc); (void) uj (de); } % gcc-11.0.0 -O2 -fno-ipa-modref -c a7m1ghpt.c during IPA pass: inline a7m1ghpt.c: In function 'n6': a7m1ghpt.c:31:10: internal compiler error: in duplicate, at ipa-prop.c:4251 31 | (void) uj (de); | ^~~~~~~ 0x6741de ipa_edge_args_sum_t::duplicate(cgraph_edge*, cgraph_edge*, ipa_edge_args*, ipa_edge_args*) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/ipa-prop.c:4251 0x95912b symbol_table::call_edge_duplication_hooks(cgraph_edge*, cgraph_edge*) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/cgraph.c:451 0x96d12f cgraph_edge::clone(cgraph_node*, gcall*, unsigned int, profile_count, profile_count, bool) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/cgraphclones.c:149 0xe322d7 copy_bb /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/tree-inline.c:2266 0xe332fb copy_cfg_body /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/tree-inline.c:3042 0xe332fb copy_body /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/tree-inline.c:3290 0xe36714 expand_call_inline /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/tree-inline.c:5076 0xe38391 gimple_expand_calls_inline /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/tree-inline.c:5266 0xe38391 optimize_inline_calls(tree_node*) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/tree-inline.c:5439 0xb92863 inline_transform(cgraph_node*) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/ipa-inline-transform.c:741 0xccd67d execute_one_ipa_transform_pass /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/passes.c:2240 0xccd67d execute_all_ipa_transforms(bool) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/passes.c:2279 0x968683 cgraph_node::expand() /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/cgraphunit.c:2302 0x969c1d expand_all_functions /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/cgraphunit.c:2480 0x969c1d symbol_table::compile() /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/cgraphunit.c:2843 0x96c092 symbol_table::compile() /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/cgraphunit.c:2756 0x96c092 symbol_table::finalize_compilation_unit() /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200927/work/gcc-11-20200927/gcc/cgraphunit.c:3021