https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121202
Bug ID: 121202 Summary: ICE on valid code at -O3 with -fno-tree-copy-prop on x86_64-linux-gnu: in vect_schedule_slp_node, at tree-vect-slp.cc:11381 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: --- Compiler Explorer: https://godbolt.org/z/McYd5M8Mq It appears to be a recent regression as it doesn't reproduce with 15.1 and earlier. [523] % 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/16.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 16.0.0 20250721 (experimental) (GCC) [524] % [524] % gcctk -O3 -fno-tree-copy-prop small.c during GIMPLE pass: vect small.c: In function ‘main’: small.c:4:5: internal compiler error: in vect_schedule_slp_node, at tree-vect-slp.cc:11380 4 | int main() { | ^~~~ 0x25699e6 internal_error(char const*, ...) ../../gcc-trunk/gcc/diagnostic-global-context.cc:517 0xa014ca fancy_abort(char const*, int, char const*) ../../gcc-trunk/gcc/diagnostic.cc:1818 0x9097d2 vect_schedule_slp_node ../../gcc-trunk/gcc/tree-vect-slp.cc:11380 0x14e702f vect_schedule_slp_node ../../gcc-trunk/gcc/tree-vect-slp.cc:11269 0x14e702f vect_schedule_scc ../../gcc-trunk/gcc/tree-vect-slp.cc:11755 0x14e7727 vect_schedule_slp(vec_info*, vec<_slp_instance*, va_heap, vl_ptr> const&) ../../gcc-trunk/gcc/tree-vect-slp.cc:11900 0x14ac93a vect_transform_loop(_loop_vec_info*, gimple*) ../../gcc-trunk/gcc/tree-vect-loop.cc:11564 0x14f8f1b vect_transform_loops ../../gcc-trunk/gcc/tree-vectorizer.cc:1044 0x14f9603 try_vectorize_loop_1 ../../gcc-trunk/gcc/tree-vectorizer.cc:1193 0x14f9603 try_vectorize_loop ../../gcc-trunk/gcc/tree-vectorizer.cc:1223 0x14f9c7c execute ../../gcc-trunk/gcc/tree-vectorizer.cc:1339 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. [525] % [525] % cat small.c int a, b, c; int e(int f, int g) { return f >> g; } int h(int f) { return a > 1 ? 0 : f << a; } int main() { while (c--) b = e(h(1), a); return 0; }