Use conditional internal functions in if-conversion
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / versioned-copy-loop.c
blobbbfd1652e5eb9e11ab235f3b5f9155e48a269288
1 /* { dg-do compile } */
2 /* { dg-require-effective-target powerpc_p8vector_ok } */
3 /* { dg-options "-O3 -fdump-tree-vect-details" } */
5 /* Verify that a pure copy loop with a vectorization factor of two
6 that requires alignment will not be vectorized. See the cost
7 model hooks in rs6000.c. */
9 typedef long unsigned int size_t;
10 typedef unsigned char uint8_t;
12 extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
13 size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
15 void foo (void *dstPtr, const void *srcPtr, void *dstEnd)
17 uint8_t *d = (uint8_t*)dstPtr;
18 const uint8_t *s = (const uint8_t*)srcPtr;
19 uint8_t* const e = (uint8_t*)dstEnd;
23 memcpy (d, s, 8);
24 d += 8;
25 s += 8;
27 while (d < e);
30 /* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" } } */