https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125646
Bug ID: 125646
Summary: ICE on valid code at -O{2,3} with "-fno-tree-fre
-fno-tree-forwprop" on x86_64-linux-gnu: in
vectorizable_operation, at tree-vect-stmts.cc:6913
Product: gcc
Version: 16.0
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/9abrT5PvW
Note:
- fails: 16.1 and trunk
- works: 15.2 and earlier
[514] % 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/17.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 17.0.0 20260604 (experimental) (GCC)
[515] %
[515] % gcctk -O2 small.c; ./a.out
[516] %
[516] % gcctk -O2 -fno-tree-fre -fno-tree-forwprop small.c
during GIMPLE pass: vect
small.c: In function ‘main’:
small.c:2:5: internal compiler error: in vectorizable_operation, at
tree-vect-stmts.cc:6913
2 | int main() {
| ^~~~
0x265b99b internal_error(char const*, ...)
../../gcc-trunk/gcc/diagnostic-global-context.cc:787
0xa2f2b4 fancy_abort(char const*, int, char const*)
../../gcc-trunk/gcc/diagnostics/context.cc:1813
0x9248a4 vectorizable_operation
../../gcc-trunk/gcc/tree-vect-stmts.cc:6913
0x14f2ff0 vect_transform_stmt(vec_info*, _stmt_vec_info*,
gimple_stmt_iterator*, _slp_tree*, _slp_instance*)
../../gcc-trunk/gcc/tree-vect-stmts.cc:13423
0x15342af vect_schedule_slp_node
../../gcc-trunk/gcc/tree-vect-slp.cc:12007
0x15565b5 vect_schedule_slp_node
../../gcc-trunk/gcc/tree-vect-slp.cc:11776
0x15565b5 vect_schedule_scc
../../gcc-trunk/gcc/tree-vect-slp.cc:12306
0x1557669 vect_schedule_slp(vec_info*, vec<_slp_instance*, va_heap, vl_ptr>
const&)
../../gcc-trunk/gcc/tree-vect-slp.cc:12399
0x1504b1c vect_transform_loop(_loop_vec_info*, gimple*)
../../gcc-trunk/gcc/tree-vect-loop.cc:11353
0x15693fb vect_transform_loops
../../gcc-trunk/gcc/tree-vectorizer.cc:1036
0x1569ae3 try_vectorize_loop_1
../../gcc-trunk/gcc/tree-vectorizer.cc:1185
0x1569ae3 try_vectorize_loop
../../gcc-trunk/gcc/tree-vectorizer.cc:1215
0x156a17c execute
../../gcc-trunk/gcc/tree-vectorizer.cc:1332
/local/home/suz/suz-local/software/local/gcc-trunk/bin/../libexec/gcc/x86_64-pc-linux-gnu/17.0.0/cc1
-quiet -I /usr/local/include -I /local/suz-local/software/local/include
-imultiarch x86_64-linux-gnu -iprefix
/local/home/suz/suz-local/software/local/gcc-trunk/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 -O2 -fno-tree-fre -fno-tree-forwprop -o /tmp/ccESppr5.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.
[517] %
[517] % cat small.c
int a;
int main() {
int c = 1;
while (1) {
a = 2 * a;
c = -1 - 1 / c;
if (!c)
break;
a = -2 * a;
}
return 0;
}