https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125185
Bug ID: 125185
Summary: [16/17 regression] ICE when building ffmpeg-8.1 with
-march=bdver2
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: sjames at gcc dot gnu.org
Target Milestone: ---
```
long sum;
int *coef1;
void ac3_sum_square_butterfly_int32_c(int i, int cap) {
for (; i < cap; i++) {
int md = i + coef1[i];
sum += (long)md * md;
}
}
```
```
$ gcc -c ffmpeg.i -O2 -march=bdver2
during GIMPLE pass: vect
ffmpeg.i: In function ‘ac3_sum_square_butterfly_int32_c’:
ffmpeg.i:4:6: internal compiler error: in vect_analyze_slp_reduc_chain, at
tree-vect-slp.cc:4384
4 | void ac3_sum_square_butterfly_int32_c(int i, int cap) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x5633178bfc83 internal_error(char const*, ...)
/usr/src/debug/sys-devel/gcc-17.0.9999/gcc-17.0.9999/gcc/diagnostic-global-context.cc:787
0x5633178bfd7a fancy_abort(char const*, int, char const*)
/usr/src/debug/sys-devel/gcc-17.0.9999/gcc-17.0.9999/gcc/diagnostics/context.cc:1813
0x563316ae5daa vect_analyze_slp_reduc_chain
/usr/src/debug/sys-devel/gcc-17.0.9999/gcc-17.0.9999/gcc/tree-vect-slp.cc:4384
0x5633187e9fb2 vect_analyze_slp_reduction
/usr/src/debug/sys-devel/gcc-17.0.9999/gcc-17.0.9999/gcc/tree-vect-slp.cc:4729
0x56331878620f vect_analyze_slp_reductions
/usr/src/debug/sys-devel/gcc-17.0.9999/gcc-17.0.9999/gcc/tree-vect-slp.cc:4901
0x5633181911ec vect_analyze_slp(vec_info*, unsigned int, bool)
/usr/src/debug/sys-devel/gcc-17.0.9999/gcc-17.0.9999/gcc/tree-vect-slp.cc:5892
0x5633183918dd vect_analyze_loop_2
/usr/src/debug/sys-devel/gcc-17.0.9999/gcc-17.0.9999/gcc/tree-vect-loop.cc:2279
0x56331877547b vect_analyze_loop_1
/usr/src/debug/sys-devel/gcc-17.0.9999/gcc-17.0.9999/gcc/tree-vect-loop.cc:2812
0x56331837cdef vect_analyze_loop(loop*, gimple*, vec_info_shared*)
/usr/src/debug/sys-devel/gcc-17.0.9999/gcc-17.0.9999/gcc/tree-vect-loop.cc:2993
0x563318773dbc try_vectorize_loop_1
/usr/src/debug/sys-devel/gcc-17.0.9999/gcc-17.0.9999/gcc/tree-vectorizer.cc:1096
0x563318773dbc try_vectorize_loop
/usr/src/debug/sys-devel/gcc-17.0.9999/gcc-17.0.9999/gcc/tree-vectorizer.cc:1215
0x56331827ae6d execute
/usr/src/debug/sys-devel/gcc-17.0.9999/gcc-17.0.9999/gcc/tree-vectorizer.cc:1332
/usr/libexec/gcc/x86_64-pc-linux-gnu/17/cc1 -fpreprocessed ffmpeg.i -quiet
-dumpbase ffmpeg.i -dumpbase-ext .i -march=bdver2 -mtls-dialect=gnu2 -O2
-foffload-options=-fno-stack-protector -fcf-protection
-foffload-options=-fcf-protection=none -o /tmp/ccXhM32N.s
```
```
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/17/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-17.0.9999/work/gcc-17.0.9999/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/17
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/17/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/17
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/17/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/17/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/17/include/g++-v17
--disable-silent-rules --disable-dependency-tracking
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/17/python
--enable-libphobos --enable-objc-gc
--enable-languages=c,c++,d,objc,obj-c++,fortran,ada,rust --enable-obsolete
--enable-secureplt --disable-werror --with-system-zlib --enable-nls
--without-included-gettext --disable-libunwind-exceptions
--enable-checking=yes,extra,rtl --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo 17.0.9999 p, commit
ebd66ec5698210c76cb60031a4d44b780e2a7235' --with-gcc-major-version-only
--enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch
--enable-linker-build-id --enable-libada --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --with-tls=gnu2 --enable-multilib
--with-multilib-list=m32,mx32,m64 --disable-fixed-point --with-abi=m64
--enable-targets=all --enable-offload-defaulted
--enable-offload-targets=nvptx-none --enable-libgomp --disable-libssp
--enable-cet --disable-systemtap --enable-valgrind-annotations
--enable-valgrind-interop --disable-vtable-verify --disable-libvtv --with-zstd
--without-isl --enable-default-pie --enable-host-pie --enable-host-bind-now
--enable-default-ssp --disable-fixincludes
--with-gxx-libcxx-include-dir=/usr/include/c++/v1
--with-build-config='bootstrap-O3 bootstrap-lto bootstrap-cet'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 17.0.0 20260504 (experimental)
40f567d9cabc5170ed396025d516b93838f4f141 (Gentoo 17.0.9999 p, commit
ebd66ec5698210c76cb60031a4d44b780e2a7235)
```