1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

configure: don't disable '-ftree-vectorize' on GCC >= 13 on major architectures

This changes configure to stop disabling -ftree-vectorize on
GCC versions 13 and newer, on major architectures.

Background:
- Original `-fno-tree-vectorize` was added in 2009 in commit
  973859f523 to avoid compiler errors.
- Re-enabled in 2016 in commit cb8646af24 but caused failures due
  to inline CABAC assembly issues and was disabled again in
  fd6dbc5385.
- Commit 182663a58a in 2023 fixed the inline CABAC assembly issues.
- Recent versions of GCC, in particular 13 and newer, seem to
  generally work reliably with respect to vectorization, although bugs
  have been observed on Loongarch.

Cautiously allow the GCC default of having vectorization enabled,
on major architectures where we expect to see enough testing. If
further issues are observed, they should be reported and noted here in
configure, so the workarounds can be scoped and version limited.
This commit is contained in:
Jiawei
2025-07-14 19:29:57 +08:00
committed by Martin Storsjö
parent 3b0ab68414
commit 1464930696
2 changed files with 20 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ version <next>:
- OpenHarmony hardware decoder/encoder - OpenHarmony hardware decoder/encoder
- Colordetect filter - Colordetect filter
- Add vf_scale_d3d11 filter - Add vf_scale_d3d11 filter
- No longer disabling GCC autovectorization, on X86, ARM and AArch64
version 7.1: version 7.1:

20
configure vendored
View File

@@ -7729,7 +7729,25 @@ if enabled icc; then
disable aligned_stack disable aligned_stack
fi fi
elif enabled gcc; then elif enabled gcc; then
check_optflags -fno-tree-vectorize gcc_version=$($cc -dumpversion)
major_version=${gcc_version%%.*}
if [ $major_version -lt 13 ]; then
# Disable tree-vectorize for GCC <13 - it has historically been buggy.
check_optflags -fno-tree-vectorize
else
case $arch in
x86|arm|aarch64)
# Allow the default of having tree-vectorize enabled on well tested
# architectures.
;;
*)
# Disable tree-vectorize on potentially less tested
# architectures. Known issues:
# - https://gcc.gnu.org/PR121064 on Loongarch
check_optflags -fno-tree-vectorize
;;
esac
fi
check_cflags -Werror=format-security check_cflags -Werror=format-security
check_cflags -Werror=implicit-function-declaration check_cflags -Werror=implicit-function-declaration
check_cflags -Werror=missing-prototypes check_cflags -Werror=missing-prototypes