diff --git a/libcxx/include/experimental/__simd/vec_ext.h b/libcxx/include/experimental/__simd/vec_ext.h index ce60a4c6c0fd35c..22e6b0992231eb5 100644 --- a/libcxx/include/experimental/__simd/vec_ext.h +++ b/libcxx/include/experimental/__simd/vec_ext.h @@ -37,7 +37,10 @@ inline constexpr bool is_abi_tag_v> = _Np > 0 && _Np <= template struct __simd_storage<_Tp, simd_abi::__vec_ext<_Np>> { - _Tp __data __attribute__((__vector_size__(std::__bit_ceil((sizeof(_Tp) * _Np))))); + // Workaround for GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105233 + static constexpr size_t __vector_size = std::__bit_ceil((sizeof(_Tp) * _Np)); + + _Tp __data __attribute__((__vector_size__(__vector_size))); _LIBCPP_HIDE_FROM_ABI _Tp __get(size_t __idx) const noexcept { _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__idx < _Np, "Index is out of bounds");