https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102080
--- Comment #14 from Martin Liška <marxin at gcc dot gnu.org> --- Even simpler test-case: #pragma GCC target "avx" typedef float __m256 __attribute__((__vector_size__(32))); __m256 _mm256_blendv_ps___Y, _mm256_blendv_ps___M, _mm256_mul_ps___A, _mm256_mul_ps___B, IfThenElse___trans_tmp_9; struct Raw256 { using type = __m256; }; struct Vec256 { using Raw = Raw256::type; Raw raw; } UndoXYBInPlace_linear_g; Vec256 IfThenElse(Vec256 no) { IfThenElse___trans_tmp_9 = __builtin_ia32_blendvps256( no.raw, _mm256_blendv_ps___Y, _mm256_blendv_ps___M); return {IfThenElse___trans_tmp_9}; } Vec256 operator*(Vec256, Vec256) { __m256 __trans_tmp_11 = _mm256_mul_ps___A * _mm256_mul_ps___B; return {__trans_tmp_11}; } struct TF_SRGB { template <class D, class V> void EncodedFromDisplay(D, V x) { Vec256 __trans_tmp_12, linear = x * __trans_tmp_12; IfThenElse(linear); } }; #pragma GCC target "avx512vl" void UndoXYBInPlace_d() { TF_SRGB().EncodedFromDisplay(UndoXYBInPlace_d, UndoXYBInPlace_linear_g); }