https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112636
Bug ID: 112636 Summary: ICE on valid code at -O1 (but not at -O{0,s,2,3}) with "-ftree-vectorize": in adjust_loop_info_after_peeling, at tree-ssa-loop-ivcanon.cc:1069 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 recent regression as it does not seem to reproduce with 13.2. Compiler Explorer: https://godbolt.org/z/WYsasWefh [526] % 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 --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.0 20231119 (experimental) (GCC) [527] % [527] % gcctk -O1 small.c; ./a.out [528] % [528] % gcctk -O1 -ftree-vectorize small.c during GIMPLE pass: ch_vect small.c: In function ‘main’: small.c:3:5: internal compiler error: in adjust_loop_info_after_peeling, at tree-ssa-loop-ivcanon.cc:1069 3 | int main() { | ^~~~ 0x87ac95 adjust_loop_info_after_peeling(loop*, int, bool) ../../gcc-trunk/gcc/tree-ssa-loop-ivcanon.cc:1069 0x129b514 copy_headers ../../gcc-trunk/gcc/tree-ssa-loop-ch.cc:1108 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. [529] % [529] % cat small.c int a[1], b; unsigned c; int main() { while (b) { if (a[c]) break; c--; } return 0; }