aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/pr71264.c
blob: b372c00832a5546356d54604444a217b03fdfde9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do compile } */

typedef unsigned char uint8_t;
typedef uint8_t footype __attribute__((vector_size(4)));

void test(uint8_t *ptr, uint8_t *mask)
{
  footype mv;
  ptr = __builtin_assume_aligned (ptr, __alignof__ (footype));
  mask = __builtin_assume_aligned (mask, __alignof__ (footype));
  __builtin_memcpy(&mv, mask, sizeof(mv));
  for (unsigned i = 0; i < 16; i += 4)
    {
      footype temp;
      __builtin_memcpy(&temp, &ptr[i], sizeof(temp));
      temp ^= mv;
      __builtin_memcpy(&ptr[i], &temp, sizeof(temp));
    }
}