comparison gcc/testsuite/gcc.dg/vect/section-anchors-vect-69.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
2 /* { dg-additional-options "--param vect-max-peeling-for-alignment=0" } */ 2 /* { dg-additional-options "--param vect-max-peeling-for-alignment=0" } */
3 3
4 #include <stdarg.h> 4 #include <stdarg.h>
5 #include "tree-vect.h" 5 #include "tree-vect.h"
6 6
7 #define N 32 7 #if VECTOR_BITS > 128
8 #define NINTS (VECTOR_BITS / 32)
9 #else
10 #define NINTS 4
11 #endif
12
13 #define N (NINTS * 8)
8 14
9 struct s{ 15 struct s{
10 int m; 16 int m;
11 int n[N][N][N]; 17 int n[N][N][N];
12 }; 18 };
16 int n[N-1][N-1][N-1]; 22 int n[N-1][N-1][N-1];
17 }; 23 };
18 24
19 struct test1{ 25 struct test1{
20 struct s a; /* array a.n is unaligned */ 26 struct s a; /* array a.n is unaligned */
21 int b; 27 int pad[NINTS - 2];
22 int c;
23 struct s e; /* array e.n is aligned */ 28 struct s e; /* array e.n is aligned */
24 }; 29 };
25 30
26 struct test2{ 31 struct test2{
27 struct s2 a; /* array a.n is unaligned */ 32 struct s2 a;
28 int b; 33 int b;
29 int c; 34 int c;
30 struct s2 e; /* array e.n is aligned */ 35 struct s2 e;
31 }; 36 };
32 37
33 38
34 struct test1 tmp1[4]; 39 struct test1 tmp1[4];
35 struct test2 tmp2[4]; 40 struct test2 tmp2[4];
50 if (tmp1[2].a.n[1][2][i] != 5) 55 if (tmp1[2].a.n[1][2][i] != 5)
51 abort (); 56 abort ();
52 } 57 }
53 58
54 /* 2. aligned */ 59 /* 2. aligned */
55 for (i = 3; i < N-1; i++) 60 for (i = NINTS - 1; i < N - 1; i++)
56 { 61 {
57 tmp1[2].a.n[1][2][i] = 6; 62 tmp1[2].a.n[1][2][i] = 6;
58 } 63 }
59 64
60 /* check results: */ 65 /* check results: */
61 for (i = 3; i < N-1; i++) 66 for (i = NINTS - 1; i < N - 1; i++)
62 { 67 {
63 if (tmp1[2].a.n[1][2][i] != 6) 68 if (tmp1[2].a.n[1][2][i] != 6)
64 abort (); 69 abort ();
65 } 70 }
66 71
82 abort (); 87 abort ();
83 } 88 }
84 } 89 }
85 90
86 /* 4. unaligned */ 91 /* 4. unaligned */
87 for (i = 0; i < N-4; i++) 92 for (i = 0; i < N - NINTS; i++)
88 { 93 {
89 for (j = 0; j < N-4; j++) 94 for (j = 0; j < N - NINTS; j++)
90 { 95 {
91 tmp2[2].e.n[1][i][j] = 8; 96 tmp2[2].e.n[1][i][j] = 8;
92 } 97 }
93 } 98 }
94 99
95 /* check results: */ 100 /* check results: */
96 for (i = 0; i < N-4; i++) 101 for (i = 0; i < N - NINTS; i++)
97 { 102 {
98 for (j = 0; j < N-4; j++) 103 for (j = 0; j < N - NINTS; j++)
99 { 104 {
100 if (tmp2[2].e.n[1][i][j] != 8) 105 if (tmp2[2].e.n[1][i][j] != 8)
101 abort (); 106 abort ();
102 } 107 }
103 } 108 }