https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113707
Bug ID: 113707
Summary: ICE on valid code at -O1 on x86_64-linux-gnu:
Segmentation fault
Product: gcc
Version: unknown
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: ---
This appears to be a very recent regression (as it doesn't seem to reproduce
with the latest build from Compiler Explorer).
[532] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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 14.0.1 20240201 (experimental) (GCC)
[533] %
[533] % gcctk -O1 small.c
during GIMPLE pass: cunroll
small.c: In function ‘main’:
small.c:6:5: internal compiler error: Segmentation fault
6 | int main() {
| ^~~~
0x1161623 crash_signal
../../gcc-trunk/gcc/toplev.cc:317
0x7f2d02c7308f ???
/build/glibc-wuryBv/glibc-2.31/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0xda0c28 extract_ops_from_tree(tree_node*, tree_code*, tree_node**,
tree_node**, tree_node**)
../../gcc-trunk/gcc/gimple-expr.cc:530
0xd980e0 gimple_build_assign(tree_node*, tree_node*)
../../gcc-trunk/gcc/gimple.cc:454
0x137c91c eliminate_dom_walker::eliminate_cleanup(bool)
../../gcc-trunk/gcc/tree-ssa-sccvn.cc:7494
0x13917db do_rpo_vn_1
../../gcc-trunk/gcc/tree-ssa-sccvn.cc:8720
0x13923b3 do_rpo_vn(function*, edge_def*, bitmap_head*, bool, bool, bool,
vn_lookup_kind)
../../gcc-trunk/gcc/tree-ssa-sccvn.cc:8749
0x12df179 tree_unroll_loops_completely
../../gcc-trunk/gcc/tree-ssa-loop-ivcanon.cc:1554
0x12df2b3 execute
../../gcc-trunk/gcc/tree-ssa-loop-ivcanon.cc:1673
0x12df2b3 execute
../../gcc-trunk/gcc/tree-ssa-loop-ivcanon.cc:1663
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.
[534] %
[534] % cat small.c
int printf(const char *, ...);
struct a {
int b;
} n;
int a, c, d, e, f = 1, g, h, j = 1, k, l, m, o;
int main() {
struct a p;
int i;
p.b = 1;
if (!j)
goto q;
p.b = i = 0;
for (; i < 1; i++)
if (k)
while (m)
r:
q:
if (p.b)
g = 1;
while (1) {
i = 0;
for (; i < 5; i++)
;
if (l) {
while (h)
;
if (o) {
d = 0;
for (; d < 8; d++)
;
}
}
for (; e; e--)
while (a)
p = n;
if (c)
goto r;
printf("0");
if (f)
break;
}
return 0;
}