https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125727
Bug ID: 125727
Summary: ICE on valid code at -O{s,2,3} with
"-fno-tree-forwprop -fno-tree-pre -fno-tree-vrp
-fno-tree-dce" on x86_64-linux-gnu: in
simplify_subreg, at simplify-rtx.cc:8465
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: https://godbolt.org/z/79Y9EeGzr
Note:
- fails: 16.1 and trunk
- works: 15.2 and earlier
[517] % 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++ --disable-werror --enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 17.0.0 20260610 (experimental) (GCC)
[518] %
[518] % gcctk -O2 -c -fno-tree-forwprop -fno-tree-pre -fno-tree-vrp
-fno-tree-dce small.c
during RTL pass: combine
small.c: In function ādā:
small.c:13:1: internal compiler error: in simplify_subreg, at
simplify-rtx.cc:8465
13 | }
| ^
0x265e66b internal_error(char const*, ...)
../../gcc-trunk/gcc/diagnostic-global-context.cc:787
0xa2f89a fancy_abort(char const*, int, char const*)
../../gcc-trunk/gcc/diagnostics/context.cc:1813
0x8b243e simplify_context::simplify_subreg(machine_mode, rtx_def*,
machine_mode, poly_int<1u, unsigned long>)
../../gcc-trunk/gcc/simplify-rtx.cc:8465
0x11cb794 operator()
../../gcc-trunk/gcc/simplify-rtx.cc:8719
0x11cb794 simplify_context::simplify_subreg(machine_mode, rtx_def*,
machine_mode, poly_int<1u, unsigned long>)
../../gcc-trunk/gcc/simplify-rtx.cc:8759
0x11cd44d simplify_context::simplify_gen_subreg(machine_mode, rtx_def*,
machine_mode, poly_int<1u, unsigned long>)
../../gcc-trunk/gcc/simplify-rtx.cc:8867
0x238fa7a lowpart_subreg(machine_mode, rtx_def*, machine_mode)
../../gcc-trunk/gcc/rtl.h:3636
0x238fa7a gen_lowpart_for_combine
../../gcc-trunk/gcc/combine.cc:11879
0x23972be force_int_to_mode
../../gcc-trunk/gcc/combine.cc:9245
0x23972be force_to_mode
../../gcc-trunk/gcc/combine.cc:8763
0x2396f89 force_int_to_mode
../../gcc-trunk/gcc/combine.cc:8959
0x2396f89 force_to_mode
../../gcc-trunk/gcc/combine.cc:8763
0x239d808 simplify_set
../../gcc-trunk/gcc/combine.cc:6864
0x23a102f subst
../../gcc-trunk/gcc/combine.cc:5662
0x23a1295 subst
../../gcc-trunk/gcc/combine.cc:5523
0x23a4d49 try_combine
../../gcc-trunk/gcc/combine.cc:3389
0x23aaf5a combine_instructions
../../gcc-trunk/gcc/combine.cc:1337
0x23aaf5a rest_of_handle_combine
../../gcc-trunk/gcc/combine.cc:15224
0x23aaf5a execute
../../gcc-trunk/gcc/combine.cc:15268
/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-tree-forwprop -fno-tree-pre -fno-tree-vrp -fno-tree-dce -o
/tmp/cc9YNBzQ.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.
[519] %
[519] % cat small.c
int a, c;
volatile long b;
void d() {
int e = 3;
while (b) {
int f = -1;
unsigned g = (a || 0) & ((b ^ e) & (c && f) && 1);
if (e || g)
a = g;
for (; e; e++)
;
}
}