https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125883
Bug ID: 125883
Summary: ICE on x86_64-linux-gnu: in rtl_verify_bb_insns, at
cfgrtl.cc:2842 during RTL pass: x86_cse with asm goto
at -O3
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: jiangchangwu at smail dot nju.edu.cn
Target Milestone: ---
Compiler Explorer: https://godbolt.org/z/P19danWT5
*******************************************************************************
gcc version:
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/compiler/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/17.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --disable-multilib --disable-bootstrap
--enable-languages=c,c++ --prefix=/compiler/gcc-trunk --enable-coverage
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 17.0.0 20260527 (experimental) (GCC)
*******************************************************************************
Program:
$ cat mutant.c
int a, b;
int c[0], d[0];
void e() {
__asm__ goto("" : "=r"(a) : : : f);
f:
for (; b; b++)
c[b] = d[b] = c[b] + a;
}
*******************************************************************************
Command Lines:
$ gcc -O3 -c small.c
small.c: In function 'e':
small.c:8:1: error: in basic block 2:
8 | }
| ^
small.c:8:1: error: flow control insn inside a basic block
(jump_insn 9 2 111 2 (parallel [
(set (reg:SI 134)
(asm_operands/v:SI ("") ("=r") 0 []
[]
[
(label_ref:DI 10)
] small.c:4))
(clobber (reg:CC 17 flags))
]) "small.c":4:3 -1
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil))
-> 10)
during RTL pass: x86_cse
small.c:8:1: internal compiler error: in rtl_verify_bb_insns, at cfgrtl.cc:2842
0x593a78b diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
???:0
0x591f98a internal_error(char const*, ...)
???:0
0x593af5e fancy_abort(char const*, int, char const*)
???:0
0x21dbb76 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
???:0
0x14de4b3 verify_flow_info()
???:0
/compiler/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/17.0.0/cc1 -quiet
-imultiarch x86_64-linux-gnu small.c -quiet -dumpbase small.c -dumpbase-ext .c
-mtune=generic -march=x86-64 -O3 -o /tmp/cch3pj9J.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.