https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126998
Bug ID: 126998
Summary: ICE at -O3 on x86_64-linux-gnu during GIMPLE pass:
vect
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: xintong.zhou1 at uwaterloo dot ca
Target Milestone: ---
Compiler Explorer: https://godbolt.org/z/Ge4T69Yxc
$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=/data/x27zhou/compiler-nightly/install/gcc/bin/gcc
COLLECT_LTO_WRAPPER=/data/x27zhou/compiler-nightly/install/gcc/bin/../libexec/gcc/x86_64-pc-linux-gnu/17.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /data/x27zhou/compiler-nightly/src/gcc/configure CC='ccache
clang' CXX='ccache clang++' --enable-checking=yes --disable-bootstrap
--disable-multilib --enable-languages=c,c++
--prefix=/data/x27zhou/compiler-nightly/install/gcc-new
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 17.0.0 20260822 (experimental) (GCC)
$
$ gcc-trunk -O0 small.c
$ gcc-trunk -O3 small.c
during GIMPLE pass: vect
small.c: In function âfâ:
small.c:4:6: internal compiler error: in exact_div, at poly-int.h:2179
4 | void f() {
| ^
0x2605bef internal_error(char const*, ...)
/data/x27zhou/compiler-nightly/src/gcc/gcc/diagnostic-global-context.cc:787
0x260ea2f fancy_abort(char const*, int, char const*)
/data/x27zhou/compiler-nightly/src/gcc/gcc/diagnostics/context.cc:1813
0x13a131e poly_int<1u, poly_result<unsigned long, if_nonpoly<unsigned long,
unsigned long, poly_int_traits<unsigned long>::is_poly>::type,
poly_coeff_pair_traits<unsigned long, if_nonpoly<unsigned long, unsigned long,
poly_int_traits<unsigned long>::is_poly>::type>::result_kind>::type>
exact_div<1u, unsigned long, unsigned long>(poly_int<1u, unsigned long> const&,
unsigned long)
/data/x27zhou/compiler-nightly/src/gcc/gcc/poly-int.h:2179
0x13a131e poly_int<1u, poly_result<unsigned long, unsigned long,
poly_coeff_pair_traits<unsigned long, unsigned long>::result_kind>::type>
exact_div<1u, unsigned long, unsigned long>(poly_int<1u, unsigned long> const&,
poly_int<1u, unsigned long> const&)
/data/x27zhou/compiler-nightly/src/gcc/gcc/poly-int.h:2192
0x13a131e vect_get_num_vectors(poly_int<1u, unsigned long>, tree_node*)
/data/x27zhou/compiler-nightly/src/gcc/gcc/tree-vectorizer.h:2342
0x13a131e vect_get_num_copies(vec_info*, _slp_tree*)
/data/x27zhou/compiler-nightly/src/gcc/gcc/tree-vectorizer.h:2361
0x13a131e vectorizable_lane_reducing(_loop_vec_info*, _stmt_vec_info*,
_slp_tree*, vec<stmt_info_for_cost, va_heap, vl_ptr>*)
/data/x27zhou/compiler-nightly/src/gcc/gcc/tree-vect-loop.cc:6866
0x1371cf5 vect_analyze_stmt(vec_info*, _slp_tree*, _slp_instance*,
vec<stmt_info_for_cost, va_heap, vl_ptr>*)
/data/x27zhou/compiler-nightly/src/gcc/gcc/tree-vect-stmts.cc:13100
0x13e5ff6 vect_slp_analyze_node_operations_1(vec_info*, _slp_tree*,
_slp_instance*, vec<stmt_info_for_cost, va_heap, vl_ptr>*)
/data/x27zhou/compiler-nightly/src/gcc/gcc/tree-vect-slp.cc:8795
0x13e5ff6 vect_slp_analyze_node_operations(vec_info*, _slp_tree*,
_slp_instance*, hash_set<_slp_tree*, false, default_hash_traits<_slp_tree*> >&,
vec<_slp_tree*, va_heap, vl_ptr>&, vec<stmt_info_for_cost, va_heap, vl_ptr>*)
/data/x27zhou/compiler-nightly/src/gcc/gcc/tree-vect-slp.cc:9085
0x13e516b vect_slp_analyze_operations(vec_info*)
/data/x27zhou/compiler-nightly/src/gcc/gcc/tree-vect-slp.cc:9415
0x13b9b52 vect_analyze_loop_2(_loop_vec_info*, int, bool&, unsigned int*,
bool&)
/data/x27zhou/compiler-nightly/src/gcc/gcc/tree-vect-loop.cc:2367
0x139f9a4 vect_analyze_loop_1(loop*, vec_info_shared*, vect_loop_form_info
const*, _loop_vec_info*, vec<machine_mode, va_heap, vl_ptr> const&, unsigned
int&, int, machine_mode&, bool&)
/data/x27zhou/compiler-nightly/src/gcc/gcc/tree-vect-loop.cc:2821
0x139f1de vect_analyze_loop(loop*, gimple*, vec_info_shared*)
/data/x27zhou/compiler-nightly/src/gcc/gcc/tree-vect-loop.cc:3002
0x141028e try_vectorize_loop_1(hash_table<simduid_to_vf, false, xcallocator>*&,
unsigned int*, loop*, gimple*, gimple*, function*)
/data/x27zhou/compiler-nightly/src/gcc/gcc/tree-vectorizer.cc:1099
0x141028e try_vectorize_loop(hash_table<simduid_to_vf, false, xcallocator>*&,
unsigned int*, loop*, function*)
/data/x27zhou/compiler-nightly/src/gcc/gcc/tree-vectorizer.cc:1218
0x140f9e7 (anonymous namespace)::pass_vectorize::execute(function*)
/data/x27zhou/compiler-nightly/src/gcc/gcc/tree-vectorizer.cc:0
/data/x27zhou/compiler-nightly/install/gcc/bin/../libexec/gcc/x86_64-pc-linux-gnu/17.0.0/cc1
-quiet -imultiarch x86_64-linux-gnu -iprefix
/data/x27zhou/compiler-nightly/install/gcc/bin/../lib/gcc/x86_64-pc-linux-gnu/17.0.0/
small.c -quiet -dumpdir a- -dumpbase small.c -dumpbase-ext .c -mtune=generic
-march=x86-64 -O3 -o /tmp/ccHm6srq.s
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.
$
$ cat small.c
unsigned a, c;
int b, d;
char e;
void f() {
for (; b; ++b) {
c = 0;
for (; c < 10; c++) {
d = 0;
for (; d < c; d++)
a += e;
}
}
}
int main() {}