[Bug tree-optimization/53366] wrong code generation by tree vectorizer using AVX
ubizjak at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed May 16 17:50:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53366
--- Comment #5 from Uros Bizjak <ubizjak at gmail dot com> 2012-05-16 17:25:50 UTC ---
This testcase fails with -O3 with plain SSE vectorization:
--cut here--
struct S { float v[3]; };
struct T { struct S r, i; };
struct U { struct T j[2]; };
void __attribute__((noinline))
foo (struct U *__restrict p1,
const float _Complex * __restrict x)
{
int i, j;
for (j = 0; j < 2; ++j)
{
float a = __builtin_crealf (x[j]);
float b = __builtin_cimagf (x[j]);
float c = __builtin_crealf (x[j+2]);
float d = __builtin_cimagf (x[j+2]);
for (i = 0; i < 3; ++i)
{
p1->j[j].r.v[i] += a;
p1->j[j].r.v[i] += c;
p1->j[j].i.v[i] += b;
p1->j[j].i.v[i] += d;
}
}
}
_Complex float x[4];
struct U p1;
int
main ()
{
int i, j;
for (i = 0; i < 4; ++i)
x[i] = i + 1.0iF * (2 * i);
foo (&p1, x);
for (j = 0; j < 2; ++j)
for (i = 0; i < 3; ++i)
if (p1.j[j].r.v[i] != __builtin_crealf (x[j] + x[j+2])
|| p1.j[j].i.v[i] != __builtin_cimagf (x[j] + x[j+2]))
__builtin_abort ();
return 0;
}
--cut here--
More information about the Gcc-bugs
mailing list