https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106010
Bug ID: 106010 Summary: Miss vectorization for complex type copy. Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: crazylht at gmail dot com Target Milestone: --- This is from PR105923 void foo (_Complex double *p, _Complex double* q) { for (int i = 0; i != 100000; i++) p[i] = q[i]; } gcc generates foo(double _Complex*, double _Complex*): xor eax, eax .L2: vmovsd xmm1, QWORD PTR [rsi+rax] vmovsd xmm0, QWORD PTR [rsi+8+rax] vmovsd QWORD PTR [rdi+rax], xmm1 vmovsd QWORD PTR [rdi+8+rax], xmm0 add rax, 16 cmp rax, 1600000 jne .L2 ret llvm generates: foo(double _Complex*, double _Complex*): # @foo(double _Complex*, double _Complex*) xor eax, eax .LBB0_1: # =>This Inner Loop Header: Depth=1 movups xmm0, xmmword ptr [rsi + rax] movups xmmword ptr [rdi + rax], xmm0 add rax, 16 cmp rax, 1600000 jne .LBB0_1 ret vectorizer failed because get_related_vectype_for_scalar_type failed for complex type.