http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48616
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-04-15
16:49:36 UTC ---
extern void abort (void);
int a[4] __attribute__((aligned (32)));
int b[4] __attribute__((aligned (32)));
int c[4] __attribute__((aligned (32)));
int d[4] __attribute__((aligned (32)));
int e[4] __attribute__((aligned (32)));
__attribute__((noinline, noclone))
void
foo (int i)
{
a[0] = b[0] << c[0];
a[1] = b[1] << c[1];
a[2] = b[2] << c[2];
a[3] = b[3] << c[3];
if (i)
{
d[0] = e[0] >> c[0];
d[1] = e[1] >> c[1];
d[2] = e[2] >> c[2];
d[3] = e[3] >> c[3];
}
}
int
main ()
{
int i;
int *t;
for (i = 0; i < 4; i++)
{
b[i] = 32;
c[i] = i;
e[i] = 32;
}
asm volatile ("" : : "r" (b) : "memory");
asm volatile ("" : : "r" (c) : "memory");
asm volatile ("" : "=r" (t) : "0" (d) : "memory");
foo (t != 0);
for (i = 0; i < 4; i++)
if (a[i] != (32 << i) || d[i] != (32 >> i))
abort ();
return 0;
}
is reduced testcase for -O2 -ftree-vectorize -mxop. I might try to fix this on
Monday, unless Ira beats me to do it.