This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/53366] wrong code generation by tree vectorizer using AVX
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 16 May 2012 16:48:39 +0000
- Subject: [Bug tree-optimization/53366] wrong code generation by tree vectorizer using AVX
- Auto-submitted: auto-generated
- References: <bug-53366-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53366
Uros Bizjak <ubizjak at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
--- Comment #3 from Uros Bizjak <ubizjak at gmail dot com> 2012-05-16 16:48:39 UTC ---
Even more reduced testcase, fails with -O3 -mavx, works with -O3 -msse4:
--cut here--
struct S { double v[3]; };
struct T { struct S r, i; };
struct U { struct T j[2]; };
void __attribute__((noinline))
foo (struct U *__restrict p1,
const double _Complex * __restrict x)
{
int i, j;
for (j = 0; j < 2; ++j)
{
double a = __builtin_creal (x[j]);
double b = __builtin_cimag (x[j]);
double c = __builtin_creal (x[j+2]);
double d = __builtin_cimag (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 double 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_creal (x[j] + x[j+2])
|| p1.j[j].i.v[i] != __builtin_cimag (x[j] + x[j+2]))
__builtin_abort ();
return 0;
}
--cut here--