SVE Intrinsics: Change return type of redirect_call to gcall.
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / section-anchors-vect-69.c
blobdbf65605e91c4219b6f5c6de220384ed09e999a7
1 /* { dg-require-effective-target section_anchors } */
2 /* { dg-additional-options "--param vect-max-peeling-for-alignment=0" } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #if VECTOR_BITS > 128
8 #define NINTS (VECTOR_BITS / 32)
9 #else
10 #define NINTS 4
11 #endif
13 #define N (NINTS * 8)
15 struct s{
16 int m;
17 int n[N][N][N];
20 struct s2{
21 int m;
22 int n[N-1][N-1][N-1];
25 struct test1{
26 struct s a; /* array a.n is unaligned */
27 int pad[NINTS - 2];
28 struct s e; /* array e.n is aligned */
31 struct test2{
32 struct s2 a;
33 int b;
34 int c;
35 struct s2 e;
39 struct test1 tmp1[4];
40 struct test2 tmp2[4];
42 int main1 ()
44 int i,j;
46 /* 1. unaligned */
47 for (i = 0; i < N; i++)
49 tmp1[2].a.n[1][2][i] = 5;
52 /* check results: */
53 #pragma GCC novector
54 for (i = 0; i <N; i++)
56 if (tmp1[2].a.n[1][2][i] != 5)
57 abort ();
60 /* 2. aligned */
61 for (i = NINTS - 1; i < N - 1; i++)
63 tmp1[2].a.n[1][2][i] = 6;
66 /* check results: */
67 #pragma GCC novector
68 for (i = NINTS - 1; i < N - 1; i++)
70 if (tmp1[2].a.n[1][2][i] != 6)
71 abort ();
74 /* 3. aligned */
75 for (i = 0; i < N; i++)
77 for (j = 0; j < N; j++)
79 tmp1[2].e.n[1][i][j] = 8;
83 /* check results: */
84 for (i = 0; i < N; i++)
86 #pragma GCC novector
87 for (j = 0; j < N; j++)
89 if (tmp1[2].e.n[1][i][j] != 8)
90 abort ();
94 /* 4. unaligned */
95 for (i = 0; i < N - NINTS; i++)
97 for (j = 0; j < N - NINTS; j++)
99 tmp2[2].e.n[1][i][j] = 8;
103 /* check results: */
104 for (i = 0; i < N - NINTS; i++)
106 #pragma GCC novector
107 for (j = 0; j < N - NINTS; j++)
109 if (tmp2[2].e.n[1][i][j] != 8)
110 abort ();
114 return 0;
117 int main (void)
119 check_vect ();
121 return main1 ();
124 /* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" { target vect_int } } } */
125 /* Alignment forced using versioning until the pass that increases alignment
126 is extended to handle structs. */
127 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 4 "vect" { target {vect_int && {! vector_alignment_reachable} } } } } */