https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43147
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Target Milestone|--- |13.0 Resolution|--- |FIXED --- Comment #21 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Constant folding part was fixed in GCC 12 but combining shuffles was fixed in GCC 13. That is for: ``` __m128 m; int main() { m = _mm_shuffle_ps(m, m, 0xC9); // Those two shuffles together swap pairs m = _mm_shuffle_ps(m, m, 0x2D); // And could be optimized to 0x4E printv(m); return 0; } ``` GCC 13+ Produces: ``` movaps m(%rip), %xmm0 shufps $78, %xmm0, %xmm0 movaps %xmm0, m(%rip) call _Z6printvDv4_f ``` instead of what was there in GCC 12: ``` movaps m(%rip), %xmm0 shufps $201, %xmm0, %xmm0 shufps $45, %xmm0, %xmm0 movaps %xmm0, m(%rip) ``` So closing as fixed in GCC 13.