https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114960
Bug ID: 114960 Summary: [12/13/14/15 Regression] fails to clean up vector casts Product: gcc Version: 12.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: amonakov at gcc dot gnu.org Target Milestone: --- Target: x86_64-*-* #include <immintrin.h> __m128i f(__m128i dummy, __m128i x) { __v16qi v = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; return (__m128i)((__v16qi)x + v); } Starting from gcc-12, we get movdqa .LC0(%rip), %xmm2 paddb %xmm1, %xmm2 movdqa %xmm2, %xmm0 ret while previously it was movdqa .LC0(%rip), %xmm0 paddb %xmm1, %xmm0 ret Diverges in RTL land, starting in combine.