https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117648
Bug ID: 117648 Summary: ICE on x86_64-linux-gnu: Segmentation fault at -O2 and above with "-fno-tree-ter -fno-tree-ch -fselective-scheduling2 -gstatement-frontiers" Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: iamanonymous.cs at gmail dot com Target Milestone: --- Compiler Explorer: https://godbolt.org/z/oG65n7ErW ******************************************************************************* gcc version: Using built-in specs. COLLECT_GCC=/home/software/gcc-trunk/bin/gcc COLLECT_LTO_WRAPPER=/home/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc/configure --disable-bootstrap --enable-checking=yes --prefix=/home/software/gcc-trunk --enable-sanitizers --enable-languages=c,c++ --disable-werror --enable-multilib --enable-coverage Thread model: posix Supported LTO compression algorithms: zlib gcc version 15.0.0 20241107 (experimental) (GCC) ******************************************************************************* Program: $ cat mutant.c char *a, *b; int c, d, e; void f() { for (; c; d++) if (a[d] == '.' || a[d] == '+' || a[d] == '*') b[e] = a[d] == '*' ?: '\\'; } ******************************************************************************* Command Lines: $ gcc -O2 -fno-tree-ter -fno-tree-ch -fselective-scheduling2 -gstatement-frontiers mutant.c during RTL pass: sched2 mutant.c: In function 'f': mutant.c:7:1: internal compiler error: Segmentation fault 7 | } | ^ 0x560e124 internal_error(char const*, ...) ../../gcc/gcc/diagnostic-global-context.cc:518 0x1fd3926 crash_signal ../../gcc/gcc/toplev.cc:323 0x1f1959d moving_insn_creates_bookkeeping_block_p ../../gcc/gcc/sel-sched.cc:2039 0x1f1a312 moveup_expr ../../gcc/gcc/sel-sched.cc:2207 0x1f1bbe9 moveup_expr_cached ../../gcc/gcc/sel-sched.cc:2552 0x1f2c06b move_op_ascend ../../gcc/gcc/sel-sched.cc:6157 0x1f2d81e code_motion_path_driver ../../gcc/gcc/sel-sched.cc:6656 0x1f2c7ee code_motion_process_successors ../../gcc/gcc/sel-sched.cc:6350 0x1f2d659 code_motion_path_driver ../../gcc/gcc/sel-sched.cc:6616 0x1f2c7ee code_motion_process_successors ../../gcc/gcc/sel-sched.cc:6350 0x1f2d659 code_motion_path_driver ../../gcc/gcc/sel-sched.cc:6616 0x1f2da97 move_op ../../gcc/gcc/sel-sched.cc:6710 0x1f28077 move_exprs_to_boundary ../../gcc/gcc/sel-sched.cc:5231 0x1f29698 schedule_expr_on_boundary ../../gcc/gcc/sel-sched.cc:5444 0x1f29f6b fill_insns ../../gcc/gcc/sel-sched.cc:5586 0x1f3099e schedule_on_fences ../../gcc/gcc/sel-sched.cc:7361 0x1f3130c sel_sched_region_2 ../../gcc/gcc/sel-sched.cc:7499 0x1f315e2 sel_sched_region_1 ../../gcc/gcc/sel-sched.cc:7541 0x1f31e5d sel_sched_region(int) ../../gcc/gcc/sel-sched.cc:7642 0x1f32252 run_selective_scheduling() ../../gcc/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.