__m64 and aliasing

Jan Hubicka jh@suse.cz
Wed Jun 19 09:19:00 GMT 2002


Hi,
bugreport 6783 seems to show alliasing problem in:

unsigned char a[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
unsigned char b[8] = { 10, 20, 30, 40, 50, 60, 70, 80 };
unsigned char c[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
__m64 m0, m1, m2;
int i;

m0 = *(__m64 *) a;
m1 = *(__m64 *) b;
m2 = _mm_adds_pu8 (m0, m1);

GCC appears to assume that the copy from a to m0 does not alias with the
array so the initialization code is scheduled afterwards.
Is the testcase buggy or we need to fix the aliasing problem?

Honza



More information about the Gcc-bugs mailing list