https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109689
Bug ID: 109689
Summary: ICE at -O1 with "-ftree-vectorize": in
check_loop_closed_ssa_def, at
tree-ssa-loop-manip.cc:645
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.
Compiler Explorer: https://godbolt.org/z/nv9dPa1Y7
[629] % 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.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--prefix=/local/suz-local/software/local/gcc-trunk --enable-languages=c,c++
--disable-werror --disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20230501 (experimental) (GCC)
[630] %
[630] % gcctk -O1 -ftree-vectorize small.c
during GIMPLE pass: ch_vect
small.c: In function ‘main’:
small.c:2:5: internal compiler error: in check_loop_closed_ssa_def, at
tree-ssa-loop-manip.cc:645
2 | int main() {
| ^~~~
0x822c59 check_loop_closed_ssa_def
../../gcc-trunk/gcc/tree-ssa-loop-manip.cc:645
0x11cfc34 check_loop_closed_ssa_bb
../../gcc-trunk/gcc/tree-ssa-loop-manip.cc:659
0x11d18be verify_loop_closed_ssa(bool, loop*)
../../gcc-trunk/gcc/tree-ssa-loop-manip.cc:695
0x11d18be verify_loop_closed_ssa(bool, loop*)
../../gcc-trunk/gcc/tree-ssa-loop-manip.cc:679
0xf243f9 execute_function_todo
../../gcc-trunk/gcc/passes.cc:2116
0xf24bfe execute_todo
../../gcc-trunk/gcc/passes.cc:2152
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.
[631] %
[631] % cat small.c
int a, b, c, d, e;
int main() {
char f;
while (a) {
int g, h = 3;
if (b)
i:
if (d)
goto j;
k:
if (a) {
j:
if (!g)
goto k;
if (e) {
while (e)
e = f;
h = 0;
goto i;
}
if (!h)
for (; g < 1; g++)
;
g = ~((~c & h & c) ^ ~g);
if (!g)
for (; a < 1; a++)
f++;
}
}
return 0;
}