https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117041
Bug ID: 117041
Summary: ICE on valid code at -O3 on x86_64-linux-gnu: in
vectorizable_load, at tree-vect-stmts.cc:10327
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: ---
It appears to be a recent regression as it doesn't reproduce with 14.2 and
earlier.
Compiler Explorer: https://godbolt.org/z/oaM8cWM96
[533] % 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/15.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 15.0.0 20241009 (experimental) (GCC)
[534] %
[534] % gcctk -O3 small.c
during GIMPLE pass: vect
small.c: In function ‘main’:
small.c:3:5: internal compiler error: in vectorizable_load, at
tree-vect-stmts.cc:10327
3 | int main() {
| ^~~~
0x2611df5 internal_error(char const*, ...)
../../gcc-trunk/gcc/diagnostic-global-context.cc:517
0xa7faf0 fancy_abort(char const*, int, char const*)
../../gcc-trunk/gcc/diagnostic.cc:1617
0x8ee2da vectorizable_load
../../gcc-trunk/gcc/tree-vect-stmts.cc:10327
0x14ae36a vect_analyze_stmt(vec_info*, _stmt_vec_info*, bool*, _slp_tree*,
_slp_instance*, vec<stmt_info_for_cost, va_heap, vl_ptr>*)
../../gcc-trunk/gcc/tree-vect-stmts.cc:13428
0x1511806 vect_slp_analyze_node_operations_1
../../gcc-trunk/gcc/tree-vect-slp.cc:7402
0x1511806 vect_slp_analyze_node_operations
../../gcc-trunk/gcc/tree-vect-slp.cc:7606
0x151171c vect_slp_analyze_node_operations
../../gcc-trunk/gcc/tree-vect-slp.cc:7583
0x151373f vect_slp_analyze_operations(vec_info*)
../../gcc-trunk/gcc/tree-vect-slp.cc:8001
0x14d9887 vect_analyze_loop_2
../../gcc-trunk/gcc/tree-vect-loop.cc:2977
0x14db603 vect_analyze_loop_1
../../gcc-trunk/gcc/tree-vect-loop.cc:3452
0x14dbdde vect_analyze_loop(loop*, gimple*, vec_info_shared*)
../../gcc-trunk/gcc/tree-vect-loop.cc:3612
0x1529926 try_vectorize_loop_1
../../gcc-trunk/gcc/tree-vectorizer.cc:1071
0x1529926 try_vectorize_loop
../../gcc-trunk/gcc/tree-vectorizer.cc:1187
0x152a1fc execute
../../gcc-trunk/gcc/tree-vectorizer.cc:1303
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.
[535] %
[535] % cat small.c
unsigned short a;
int b, c[7][6];
int main() {
for (a = 0; a < 6; a++)
for (b = 5; b; b--)
c[a][b] = c[a+1][b];
return 0;
}