https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89749
Bug ID: 89749 Summary: Very odd vector constructor Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: hjl.tools at gmail dot com Target Milestone: --- [hjl@gnu-cfl-2 pr88828]$ cat i1.i typedef short __v8hi __attribute__ ((__vector_size__ (16))); typedef long long int __m128i __attribute__ ((__vector_size__ (16), __may_alias__)); __m128i foo (__m128i __A) { return (__m128i) (__v8hi) { ((__v8hi)__A)[0], ((__v8hi)__A)[1], ((__v8hi)__A)[2], ((__v8hi)__A)[3], ((__v8hi)__A)[4], ((__v8hi)__A)[5], ((__v8hi)__A)[6], ((__v8hi)__A)[7] }; } [hjl@gnu-cfl-2 pr88828]$ gcc -S -O2 i2.i [hjl@gnu-cfl-2 pr88828]$ cat i2.s .file "i2.i" .text .p2align 4,,15 .globl foo .type foo, @function foo: .LFB1: .cfi_startproc pextrw $3, %xmm0, %edx pextrw $2, %xmm0, %eax pextrw $6, %xmm0, %ecx salq $16, %rdx pextrw $0, %xmm0, %esi orq %rax, %rdx pextrw $1, %xmm0, %eax salq $16, %rdx orq %rax, %rdx pextrw $7, %xmm0, %eax salq $16, %rax salq $16, %rdx orq %rcx, %rax pextrw $5, %xmm0, %ecx orq %rsi, %rdx salq $16, %rax movq %rdx, -24(%rsp) orq %rcx, %rax pextrw $4, %xmm0, %ecx salq $16, %rax orq %rcx, %rax movq %rax, -16(%rsp) movdqa -24(%rsp), %xmm0 ret .cfi_endproc I am expecting an empty function body.