1 /* PR target/52736 */
2 /* { dg-do run } */
3 /* { dg-options "-O1 -msse2" } */
4 /* { dg-require-effective-target sse2_runtime } */
5 
6 #include <x86intrin.h>
7 
8 typedef double D __attribute__((may_alias));
9 __attribute__((aligned(16))) static const double r[4] = { 1., 5., 1., 3. };
10 
11 __attribute__((noinline, noclone))
12 void
foo(int x)13 foo (int x)
14 {
15   asm volatile ("" : "+g" (x) : : "memory");
16   if (x != 3)
17     __builtin_abort ();
18 }
19 
20 int
main()21 main ()
22 {
23   __m128d t = _mm_set1_pd (5.);
24   ((D *)(&t))[0] = 1.;
25   foo (_mm_movemask_pd (_mm_cmpeq_pd (t, _mm_load_pd (&r[0]))));
26   ((D *)(&t))[1] = 3.;
27   foo (_mm_movemask_pd (_mm_cmpeq_pd (t, _mm_load_pd (&r[2]))));
28   return 0;
29 }
30