https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101086
Bug ID: 101086 Summary: ICE at -O2 and -O3 on x86_64-linux-gnu with "-ftracer -fvar-tracking-assignments -fsel-sched-pipelining -fselective-scheduling -fschedule-insns": in create_block_for_bookkeeping, at sel-sched.c:4537 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zhendong.su at inf dot ethz.ch Target Milestone: --- It seems to affect GCC 10.* and later. [516] % gcctk -v Using built-in specs. COLLECT_GCC=gcctk COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-trunk/configure --disable-bootstrap --prefix=/local/suz-local/software/local/gcc-trunk --enable-languages=c,c++ --disable-werror --enable-multilib --with-system-zlib Thread model: posix Supported LTO compression algorithms: zlib gcc version 12.0.0 20210615 (experimental) [master revision 4602714382f:c4ce2fa5b57:6d43ec50966cafb339eb6a370a5d767a24f673e1] (GCC) [517] % [517] % gcctk -O2 -c -ftracer -fvar-tracking-assignments -fsel-sched-pipelining -fselective-scheduling -fschedule-insns small.c cc1: warning: var-tracking-assignments changes selective scheduling during RTL pass: sched1 small.c: In function ‘main’: small.c:12:1: internal compiler error: in create_block_for_bookkeeping, at sel-sched.c:4537 12 | } | ^ 0xd63b4c create_block_for_bookkeeping ../../gcc-trunk/gcc/sel-sched.c:4537 0xd63b4c find_place_for_bookkeeping ../../gcc-trunk/gcc/sel-sched.c:4686 0xd63b4c generate_bookkeeping_insn ../../gcc-trunk/gcc/sel-sched.c:4786 0xd63b4c move_op_at_first_insn ../../gcc-trunk/gcc/sel-sched.c:6063 0xd6435d code_motion_path_driver ../../gcc-trunk/gcc/sel-sched.c:6657 0xd64c6b code_motion_process_successors ../../gcc-trunk/gcc/sel-sched.c:6342 0xd64c6b code_motion_path_driver ../../gcc-trunk/gcc/sel-sched.c:6608 0xd64c6b code_motion_process_successors ../../gcc-trunk/gcc/sel-sched.c:6342 0xd64c6b code_motion_path_driver ../../gcc-trunk/gcc/sel-sched.c:6608 0xd64c6b code_motion_process_successors ../../gcc-trunk/gcc/sel-sched.c:6342 0xd64c6b code_motion_path_driver ../../gcc-trunk/gcc/sel-sched.c:6608 0xd653e3 move_op ../../gcc-trunk/gcc/sel-sched.c:6702 0xd653e3 move_exprs_to_boundary ../../gcc-trunk/gcc/sel-sched.c:5223 0xd653e3 schedule_expr_on_boundary ../../gcc-trunk/gcc/sel-sched.c:5436 0xd6928b fill_insns ../../gcc-trunk/gcc/sel-sched.c:5578 0xd6ae60 schedule_on_fences ../../gcc-trunk/gcc/sel-sched.c:7353 0xd6ae60 sel_sched_region_2 ../../gcc-trunk/gcc/sel-sched.c:7491 0xd6bd98 sel_sched_region_1 ../../gcc-trunk/gcc/sel-sched.c:7533 0xd6d1f4 sel_sched_region(int) ../../gcc-trunk/gcc/sel-sched.c:7634 0xd6da89 run_selective_scheduling() ../../gcc-trunk/gcc/sel-sched.c:7720 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. [518] % [518] % cat small.c extern int k(int); int a, b; int c(int d) { return d ? 0 : a; } unsigned e(int d, int f) { return f < 0 ? d : d << f; } int main() { int h; long i = 2412553438; while (b) if (k(c(e(h, i)))) i = 0; return 0; }