https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100898
Bug ID: 100898 Summary: ICE with -O2: in gimple_call_arg_ptr, at gimple.h:3264 Product: gcc Version: tree-ssa Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: cnsun at uwaterloo dot ca Target Milestone: --- $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/scratch/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /tmp/tmp.6GNjkccaVE-gcc-builder/gcc/configure --enable-languages=c,c++,lto --enable-checking-yes --enable-multiarch --prefix=/scratch/software/gcc-trunk --disable-bootstrap Thread model: posix Supported LTO compression algorithms: zlib gcc version 12.0.0 20210603 (experimental) [master revision :fe23f36c0:9663c744e2d0942f14eafa725a1bd9f766f02a16] (GCC) $ cat mutant.c a; fn1() { for (; a;) return bar(__builtin_va_arg_pack()); } main() { fn1(); } $ gcc-trunk -O2 mutant.c mutant.c:1:1: warning: data definition has no type or storage class 1 | a; | ^ mutant.c:1:1: warning: type defaults to ‘int’ in declaration of ‘a’ [-Wimplicit-int] mutant.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 2 | fn1() { | ^~~ mutant.c: In function ‘fn1’: mutant.c:4:12: warning: implicit declaration of function ‘bar’ [-Wimplicit-function-declaration] 4 | return bar(__builtin_va_arg_pack()); | ^~~ mutant.c: At top level: mutant.c:6:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 6 | main() { fn1(); } | ^~~~ during IPA pass: inline In function ‘fn1’: cc1: internal compiler error: in gimple_call_arg_ptr, at gimple.h:3264 0x758b10 gimple_call_arg_ptr /tmp/tmp.6GNjkccaVE-gcc-builder/gcc/gcc/gimple.h:3264 0x758b10 gimple_call_arg_ptr /tmp/tmp.6GNjkccaVE-gcc-builder/gcc/gcc/gimple.h:3262 0x758b10 copy_bb /tmp/tmp.6GNjkccaVE-gcc-builder/gcc/gcc/tree-inline.c:2085 0xf93522 copy_cfg_body /tmp/tmp.6GNjkccaVE-gcc-builder/gcc/gcc/tree-inline.c:3022 0xf93522 copy_body /tmp/tmp.6GNjkccaVE-gcc-builder/gcc/gcc/tree-inline.c:3278 0xf96a56 expand_call_inline /tmp/tmp.6GNjkccaVE-gcc-builder/gcc/gcc/tree-inline.c:5105 0xf98109 gimple_expand_calls_inline /tmp/tmp.6GNjkccaVE-gcc-builder/gcc/gcc/tree-inline.c:5300 0xf98109 optimize_inline_calls(tree_node*) /tmp/tmp.6GNjkccaVE-gcc-builder/gcc/gcc/tree-inline.c:5473 0xcbf76b inline_transform(cgraph_node*) /tmp/tmp.6GNjkccaVE-gcc-builder/gcc/gcc/ipa-inline-transform.c:790 0xe19e04 execute_one_ipa_transform_pass /tmp/tmp.6GNjkccaVE-gcc-builder/gcc/gcc/passes.c:2290 0xe19e04 execute_all_ipa_transforms(bool) /tmp/tmp.6GNjkccaVE-gcc-builder/gcc/gcc/passes.c:2337 0xa874a9 cgraph_node::expand() /tmp/tmp.6GNjkccaVE-gcc-builder/gcc/gcc/cgraphunit.c:1821 0xa888cf expand_all_functions /tmp/tmp.6GNjkccaVE-gcc-builder/gcc/gcc/cgraphunit.c:1992 0xa888cf symbol_table::compile() /tmp/tmp.6GNjkccaVE-gcc-builder/gcc/gcc/cgraphunit.c:2356 0xa8b7cb symbol_table::compile() /tmp/tmp.6GNjkccaVE-gcc-builder/gcc/gcc/cgraphunit.c:2269 0xa8b7cb symbol_table::finalize_compilation_unit() /tmp/tmp.6GNjkccaVE-gcc-builder/gcc/gcc/cgraphunit.c:2537 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions.