Debian Codegraph @

gcc/testsuite/gcc.dg/vect/no-vfa-vect-102a.c

raw
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-additional-options "--param vect-max-version-for-alias-checks=0" } */
3
4 #include <stdlib.h>
5 #include <stdarg.h>
6 #include "tree-vect.h"
7
8 #define N 9
9
10 struct extraction
11 {
12 int a[N];
13 int b[N];
14 };
15
16 static int a[N] = {1,2,3,4,5,6,7,8,9};
17 static int b[N] = {2,3,4,5,6,7,8,9,9};
18
19 __attribute__ ((noinline))
20 int main1 (int x, int y) {
21 int i;
22 struct extraction *p;
23 p = (struct extraction *) malloc (sizeof (struct extraction));
24
25 for (i = 0; i < N; i++)
26 {
27 p->a[i] = a[i];
28 asm volatile ("" ::: "memory");
29 }
30
31 /* Not vectorizable: distance 1. */
32 for (i = 0; i < N - 1; i++)
33 {
34 p->a[x + i + 1] = p->a[x + i];
35 }
36
37 /* check results: */
38 #pragma GCC novector
39 for (i = 0; i < N; i++)
40 {
41 if (p->a[i] != 1)
42 abort();
43 }
44 return 0;
45 }
46
47 int main (void)
48 {
49 check_vect ();
50
51 return main1 (0, N);
52 }
53
54 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
55 /* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 1 "vect" { target { ! vect_multiple_sizes } } } } */
56 /* { dg-final { scan-tree-dump "possible dependence between data-refs" "vect" { target vect_multiple_sizes } } } */
57