https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80381
--- Comment #3 from Sven Woop <m...@sven-woop.de> --- Right, this could be considered a user bug. However, we ran into this as we are successfully using this code sequence in our code: #include <immintrin.h> #define __forceinline inline __attribute__((always_inline)) struct vint8 { __forceinline vint8(const int i) : v(_mm256_set1_epi32(i)) {} __forceinline vint8(const __m256i& t) : v(t) {} friend __forceinline const vint8 operator >>( const vint8& a, const int n ) { return _mm256_srai_epi32(a.v, n); } __m256i v; }; vint8 test8(int shift) { const vint8 blocks_add(shift); return blocks_add >> shift; } Which is essentially the same bug for AVX2. However, this code compiles with every compiler that supports AVX2, be it GCC, Clang, or MSVC. Also the corresponding sequence for SSE compiles with every compiler we tried so far. I would have expected GCC to behave consistent for AVX-256 and AVX-512 for this code.