https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114828
Bug ID: 114828 Summary: ICE on valid code at -O1 with "-ftree-pre -fselective-scheduling -fsel-sched-pipelining -fschedule-insns" on x86_64-linux-gnu: Segmentation fault 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: --- This appears to be a recent regression and does not reproduce with 13.2 and earlier. Compiler Explorer: https://godbolt.org/z/9WdTv4qEe [576] % 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/14.0.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-trunk/configure --disable-bootstrap --enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk --enable-sanitizers --enable-languages=c,c++ --disable-werror --enable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 14.0.1 20240423 (experimental) (GCC) [577] % [577] % gcctk -c -O1 -ftree-pre -fselective-scheduling -fsel-sched-pipelining -fschedule-insns small.c during RTL pass: sched1 small.c: In function âfâ: small.c:14:1: internal compiler error: Segmentation fault 14 | } | ^ 0x116dc33 crash_signal ../../gcc-trunk/gcc/toplev.cc:319 0x7f3e0a2c608f ??? /build/glibc-e2p3jK/glibc-2.31/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0 0x110b3d4 init_expr ../../gcc-trunk/gcc/sel-sched-ir.cc:1642 0x110b3d4 copy_expr_onside(_expr*, _expr*) ../../gcc-trunk/gcc/sel-sched-ir.cc:1685 0x111b549 move_op_orig_expr_found ../../gcc-trunk/gcc/sel-sched.cc:5997 0x111f2e0 code_motion_path_driver ../../gcc-trunk/gcc/sel-sched.cc:6551 0x11200fe code_motion_process_successors ../../gcc-trunk/gcc/sel-sched.cc:6350 0x11200fe code_motion_path_driver ../../gcc-trunk/gcc/sel-sched.cc:6616 0x11200fe code_motion_process_successors ../../gcc-trunk/gcc/sel-sched.cc:6350 0x11200fe code_motion_path_driver ../../gcc-trunk/gcc/sel-sched.cc:6616 0x11238e8 move_op ../../gcc-trunk/gcc/sel-sched.cc:6710 0x11238e8 move_exprs_to_boundary ../../gcc-trunk/gcc/sel-sched.cc:5231 0x11238e8 schedule_expr_on_boundary ../../gcc-trunk/gcc/sel-sched.cc:5444 0x1125588 fill_insns ../../gcc-trunk/gcc/sel-sched.cc:5586 0x1125588 schedule_on_fences ../../gcc-trunk/gcc/sel-sched.cc:7361 0x1125588 sel_sched_region_2 ../../gcc-trunk/gcc/sel-sched.cc:7499 0x1126c78 sel_sched_region_1 ../../gcc-trunk/gcc/sel-sched.cc:7541 0x1128a19 sel_sched_region(int) ../../gcc-trunk/gcc/sel-sched.cc:7642 0x1128a19 sel_sched_region(int) ../../gcc-trunk/gcc/sel-sched.cc:7627 0x1129a21 run_selective_scheduling() ../../gcc-trunk/gcc/sel-sched.cc:7728 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. [578] % [578] % cat small.c char a, b; int c, d, e; void f() { char g = -1; L: if (e) { e = b; b = c % (d || ~g) && a % c; c = c || a ^ d; a = e || a + d + 1; f(); goto L; } }