https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41084
Alexander Monakov <amonakov at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED CC| |amonakov at gcc dot gnu.org Resolution|--- |FIXED --- Comment #2 from Alexander Monakov <amonakov at gcc dot gnu.org> --- Starting from gcc-4.5 (released in 2010) GCC emits pcmpeq for the explicit-constructor variant (where it would previously emit a load) as well as for a more concise form: __m128i r = {-1, -1}; The implicit variant with _mm_cmpeq_epi32 is optimized as expected starting with gcc-5 (released in 2015). So as far as I can see both issues raised in this report have been addressed in the meantime. If there are other cases that are not well optimized, please let us know (they deserve separate bug reports).