https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127022
Bug ID: 127022
Summary: ICE on valid code at -O{2,3} with "-fno-dce
-fsched2-use-superblocks" on x86_64-linux-gnu: in
begin_move_insn, at sched-ebb.cc:196
Product: gcc
Version: 16.0
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: ---
Compiler Explorer:
Note:
- fails: 14.1 to trunk
- works: 13.4 and earlier
[568] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/home/suz/suz-local/software/local/gcc-trunk/bin/../libexec/gcc/x86_64-pc-linux-gnu/17.0.0/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++,lto --disable-werror
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 17.0.0 20260823 (experimental) (GCC)
[569] %
[569] % gcctk -O2 -c -fno-dce -fsched2-use-superblocks small.c
during RTL pass: sched2
small.c: In function ‘main’:
small.c:15:1: internal compiler error: in begin_move_insn, at sched-ebb.cc:196
15 | }
| ^
0x284cdcb internal_error(char const*, ...)
../../gcc-trunk/gcc/diagnostic-global-context.cc:787
0xa43b0e fancy_abort(char const*, int, char const*)
../../gcc-trunk/gcc/diagnostics/context.cc:1813
0xa2ff48 begin_move_insn
../../gcc-trunk/gcc/sched-ebb.cc:196
0xa2ff48 begin_move_insn
../../gcc-trunk/gcc/sched-ebb.cc:144
0x2540c25 commit_schedule
../../gcc-trunk/gcc/haifa-sched.cc:6276
0x2540c25 schedule_block(basic_block_def**, void*)
../../gcc-trunk/gcc/haifa-sched.cc:7114
0x26253dc schedule_ebb(rtx_insn*, rtx_insn*, bool)
../../gcc-trunk/gcc/sched-ebb.cc:536
0x26259f2 schedule_ebbs()
../../gcc-trunk/gcc/sched-ebb.cc:655
0x11b8d44 rest_of_handle_sched2
../../gcc-trunk/gcc/sched-rgn.cc:3780
0x11b8d44 execute
../../gcc-trunk/gcc/sched-rgn.cc:3921
/local/home/suz/suz-local/software/local/gcc-trunk/bin/../libexec/gcc/x86_64-pc-linux-gnu/17.0.0/cc1
-quiet -I /usr/local/include -I /local/suz-local/software/local/include
-imultiarch x86_64-linux-gnu -iprefix
/local/home/suz/suz-local/software/local/gcc-trunk/bin/../lib/gcc/x86_64-pc-linux-gnu/17.0.0/
small.c -quiet -dumpbase small.c -dumpbase-ext .c -mtune=generic -march=x86-64
-O2 -fno-dce -fsched2-use-superblocks -o /tmp/cckVZEXJ.s
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.
[570] %
[570] % cat small.c
extern void c(char *, char *, int, char *) __attribute__((__noreturn__));
extern void d();
int a;
int main() {
int b;
while (a) {
d();
if (a) {
while (b)
;
c("", "foo", 1, "bar");
}
}
return 0;
}