This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/88487] union prevents autovectorization
- From: "bugzilla at poradnik-webmastera dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 13 Dec 2018 17:11:48 +0000
- Subject: [Bug middle-end/88487] union prevents autovectorization
- Auto-submitted: auto-generated
- References: <bug-88487-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88487
--- Comment #1 from Daniel Fruzynski <bugzilla@poradnik-webmastera.com> ---
Update: when pointers to data are copied to local variables like below,
autovectorization starts working again.
[code]
void test3(S2* __restrict__ s1, S2* __restrict__ s2)
{
double* __restrict__ * __restrict__ d1 = s1->d;
double* __restrict__ * __restrict__ d2 = s2->d;
for (int n = 0; n < 2; ++n)
{
d1[n][0] = d2[n][0];
d1[n][1] = d2[n][1];
}
}
[/code]