[Bug middle-end/88490] Missed autovectorization when indices are different
bugzilla@poradnik-webmastera.com
gcc-bugzilla@gcc.gnu.org
Thu Dec 13 18:10:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88490
--- Comment #1 from Daniel Fruzynski <bugzilla@poradnik-webmastera.com> ---
Ehh, small typo. This is correct version, also not vectorized:
[code]
struct S
{
double* __restrict__ * __restrict__ d;
};
void test(S* __restrict__ s, int n, int k)
{
if (n > k)
{
for (int i = 0; i < 2; ++i)
{
s->d[n][0] = s->d[k][0];
s->d[n][1] = s->d[k][1];
}
}
}
[/code]
[asm]
test(S*, int, int):
cmp esi, edx
jle .L3
mov rax, QWORD PTR [rdi]
movsx rdx, edx
mov rdx, QWORD PTR [rax+rdx*8]
movsx rsi, esi
vmovsd xmm0, QWORD PTR [rdx]
mov rax, QWORD PTR [rax+rsi*8]
vmovsd QWORD PTR [rax], xmm0
vmovsd xmm0, QWORD PTR [rdx+8]
vmovsd QWORD PTR [rax+8], xmm0
vmovsd xmm0, QWORD PTR [rdx]
vmovsd QWORD PTR [rax], xmm0
vmovsd xmm0, QWORD PTR [rdx+8]
vmovsd QWORD PTR [rax+8], xmm0
.L3:
ret
[/asm]
More information about the Gcc-bugs
mailing list