https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88922
Bug ID: 88922 Summary: Merge identical constants with different modes Product: gcc Version: 9.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: glisse at gcc dot gnu.org Target Milestone: --- #include <stdint.h> typedef int64_t v64 __attribute__((vector_size(16))); typedef int32_t v32 __attribute__((vector_size(16))); typedef int16_t v16 __attribute__((vector_size(16))); int main(){ volatile v64 x = {1,2}; volatile v32 y = {1,0,2,0}; volatile v16 z = {1,0,0,0,2,0,0,0}; } movdqa .LC0(%rip), %xmm0 xorl %eax, %eax movaps %xmm0, -56(%rsp) movdqa .LC1(%rip), %xmm0 movaps %xmm0, -40(%rsp) movdqa .LC2(%rip), %xmm0 movaps %xmm0, -24(%rsp) gcc fails to notice that the 3 constants are the same. I would have expected the constant pool to be handled as an untyped collection of bits at the end.