re PR c++/71973 (c++ handles built-in functions inconsistently)
[gcc.git] / gcc / testsuite / g++.dg / tree-ssa / pr31307.C
1 /* { dg-do compile } */
2 /* { dg-options "-O -fdump-tree-optimized" } */
3
4 union MY_M128
5 {
6 double i;
7 };
8
9 struct RegFile
10 {
11 MY_M128 dst[4];
12 };
13
14 __inline__ __attribute__((always_inline)) static void
15 MEM_OPT_LOAD(MY_M128* reg, double* mem)
16 {
17 reg[0].i = *mem;
18 }
19
20 void _ia32_movntdq (double *, double);
21
22 __inline__ __attribute__((always_inline)) static void
23 MEM_OPT_STORE(MY_M128* reg, double* mem)
24 {
25 _ia32_movntdq ((double*)mem, (double)reg[0].i);
26 }
27
28 double _mm_adds_epu8 (double __A, double __B);
29
30 int test(unsigned char *d)
31 {
32 RegFile r;
33 MEM_OPT_LOAD((r.dst) , ((double*) d));
34 r.dst[0].i = _mm_adds_epu8(r.dst[0].i, r.dst[0].i);
35 MEM_OPT_STORE((r.dst), (double*) d);
36 return 0;
37 }
38
39 /* { dg-final { scan-tree-dump-not "r.dst" "optimized" } } */