1 // { dg-do run { target i?86-*-* x86_64-*-* } } 2 // { dg-require-effective-target sse2_runtime } 3 // { dg-options "-O -msse2" } 4 5 extern "C" void abort (void); 6 7 typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__)); 8 typedef short A __attribute__((__may_alias__)); 9 10 __m128i __attribute__((noinline)) shuf(const __m128i v)11shuf(const __m128i v) 12 { 13 __m128i r; 14 15 reinterpret_cast<A *>(&r)[5] = reinterpret_cast<const A *>(&v)[4]; 16 return r; 17 } 18 main()19int main() 20 { 21 __attribute__((aligned(16))) short mem[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; 22 23 *reinterpret_cast<__m128i *>(mem) = shuf (*reinterpret_cast<__m128i *>(mem)); 24 25 if (mem[5] != 4) 26 abort (); 27 28 return 0; 29 } 30