https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121194
Bug ID: 121194 Summary: ICE on valid code at -O3: in quick_push, at vec.h:1050 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/895xeMPYe It appears to be a recent regression as it doesn't reproduce with 15.1 and earlier. [515] % 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 20250720 (experimental) (GCC) [516] % [516] % gcctk -O3 small.c during GIMPLE pass: vect small.c: In function ‘main’: small.c:10:5: internal compiler error: in quick_push, at vec.h:1050 10 | int main() { | ^~~~ 0x2564dd6 internal_error(char const*, ...) ../../gcc-trunk/gcc/diagnostic-global-context.cc:517 0xa02678 fancy_abort(char const*, int, char const*) ../../gcc-trunk/gcc/diagnostic.cc:1818 0x907fb6 vec<int, va_heap, vl_embed>::quick_push(int const&) ../../gcc-trunk/gcc/vec.h:1050 0x908648 vec<tree_node*, va_heap, vl_embed>::quick_push(tree_node* const&) ../../gcc-trunk/gcc/gimple.h:2619 0x908648 vec<tree_node*, va_heap, vl_ptr>::quick_push(tree_node* const&) ../../gcc-trunk/gcc/vec.h:2081 0x908648 _slp_tree::push_vec_def(gimple*) ../../gcc-trunk/gcc/tree-vect-slp.cc:162 0x148d5c1 vect_transform_lc_phi(_loop_vec_info*, _stmt_vec_info*, _slp_tree*) ../../gcc-trunk/gcc/tree-vect-loop.cc:8789 0x1484d48 vect_transform_stmt(vec_info*, _stmt_vec_info*, gimple_stmt_iterator*, _slp_tree*, _slp_instance*) ../../gcc-trunk/gcc/tree-vect-stmts.cc:13514 0x14ccd3d vect_schedule_slp_node ../../gcc-trunk/gcc/tree-vect-slp.cc:11503 0x14e679f vect_schedule_slp_node ../../gcc-trunk/gcc/tree-vect-slp.cc:11270 0x14e679f vect_schedule_scc ../../gcc-trunk/gcc/tree-vect-slp.cc:11756 0x14e6e97 vect_schedule_slp(vec_info*, vec<_slp_instance*, va_heap, vl_ptr> const&) ../../gcc-trunk/gcc/tree-vect-slp.cc:11901 0x14ac0aa vect_transform_loop(_loop_vec_info*, gimple*) ../../gcc-trunk/gcc/tree-vect-loop.cc:11556 0x14f86cb vect_transform_loops ../../gcc-trunk/gcc/tree-vectorizer.cc:1044 0x14f8db3 try_vectorize_loop_1 ../../gcc-trunk/gcc/tree-vectorizer.cc:1193 0x14f8db3 try_vectorize_loop ../../gcc-trunk/gcc/tree-vectorizer.cc:1223 0x14f942c 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. [517] % [517] % cat small.c int a, b, c, d; void e() { int *f = &b; for (a = 0; a < 8; a++) { *f = 0; for (c = 0; c < 2; c++) *f = *f == 0; } } int main() { e(); int *g = &b; *g = *g == (d == 0); return 0; }