summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/tree-ssa/pr31307.C
blob: bdfe5bd5ac18d407e287ffe19bd1b06a4581505a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-optimized" } */

union MY_M128
{
  double i;
};

struct RegFile
{
  MY_M128 dst[4];
};

__inline__ __attribute__((always_inline)) static void
MEM_OPT_LOAD(MY_M128* reg, double* mem)
{
  reg[0].i = *mem;
}

void _ia32_movntdq (double *, double);

__inline__ __attribute__((always_inline)) static void
MEM_OPT_STORE(MY_M128* reg, double* mem)
{
  _ia32_movntdq ((double*)mem, (double)reg[0].i);
}

double _mm_adds_epu8 (double __A, double __B);

int test(unsigned char *d)
{ 
  RegFile r;
  MEM_OPT_LOAD((r.dst) , ((double*) d)); 
  r.dst[0].i = _mm_adds_epu8(r.dst[0].i, r.dst[0].i);
  MEM_OPT_STORE((r.dst), (double*) d);
  return 0;
}

/* { dg-final { scan-tree-dump-not "r.dst" "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */