https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125579
Bug ID: 125579
Summary: ICE on valid code at -O3 with "-fno-tree-ccp
-fno-inline" on x86_64-linux-gnu: Segmentation fault
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: zhendong.su at inf dot ethz.ch
Target Milestone: ---
Note:
- fails: trunk
- works: 16.1 and earlier
- very recent as the Compiler Explorer build doesn't ICE
[521] % 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 20260602 (experimental) (GCC)
[522] %
[522] % gcctk -O3 -w small.c
[523] % gcctk -O3 -w -fno-tree-ccp -fno-inline small.c
during GIMPLE pass: backprop
small.c: In function ‘c.constprop’:
small.c:3:6: internal compiler error: Segmentation fault
3 | void c(int d) {
| ^
0x2653b8b internal_error(char const*, ...)
../../gcc-trunk/gcc/diagnostic-global-context.cc:787
0x11f5e43 crash_signal
../../gcc-trunk/gcc/toplev.cc:325
0x7ff3a76ae51f ???
./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0xde9264 gimple_bb(gimple const*)
../../gcc-trunk/gcc/gimple.h:1919
0xde9264 gsi_for_stmt(gimple*)
../../gcc-trunk/gcc/gimple-iterator.cc:628
0x2373c74 execute
../../gcc-trunk/gcc/gimple-ssa-backprop.cc:1128
0x2373c74 execute
../../gcc-trunk/gcc/gimple-ssa-backprop.cc:1166
/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 -dumpdir a- -dumpbase small.c -dumpbase-ext .c -mtune=generic
-march=x86-64 -O3 -w -fno-tree-ccp -fno-inline -o /tmp/ccQKJ9i8.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.
[524] %
[524] % cat small.c
int printf(const char *, ...);
int a;
void c(int d) {
unsigned e = 0;
if (a)
e = -(0 / (e * 0));
while (a) {
if (d)
continue;
printf("%d", e);
e++;
}
}
int main() { c(1); }