Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/vect/no-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 |
---|---|
3 /* { dg-additional-options "--param vect-max-peeling-for-alignment=0" } */ | 3 /* { dg-additional-options "--param vect-max-peeling-for-alignment=0" } */ |
4 | 4 |
5 #include <stdarg.h> | 5 #include <stdarg.h> |
6 #include "tree-vect.h" | 6 #include "tree-vect.h" |
7 | 7 |
8 #define N 24 | 8 #if VECTOR_BITS > 128 |
9 #define NINTS (VECTOR_BITS / 32) | |
10 #else | |
11 #define NINTS 4 | |
12 #endif | |
13 | |
14 #define N (NINTS * 6) | |
9 | 15 |
10 struct s{ | 16 struct s{ |
11 int m; | 17 int m; |
12 int n[N][N][N]; | 18 int n[N][N][N]; |
13 }; | 19 }; |
17 int n[N-1][N-1][N-1]; | 23 int n[N-1][N-1][N-1]; |
18 }; | 24 }; |
19 | 25 |
20 struct test1{ | 26 struct test1{ |
21 struct s a; /* array a.n is unaligned */ | 27 struct s a; /* array a.n is unaligned */ |
22 int b; | 28 int pad[NINTS - 2]; |
23 int c; | |
24 struct s e; /* array e.n is aligned */ | 29 struct s e; /* array e.n is aligned */ |
25 }; | 30 }; |
26 | 31 |
27 struct test2{ | 32 struct test2{ |
28 struct s2 a; /* array a.n is unaligned */ | 33 struct s2 a; /* array a.n is unaligned */ |
52 if (tmp1[2].a.n[1][2][i] != 5) | 57 if (tmp1[2].a.n[1][2][i] != 5) |
53 abort (); | 58 abort (); |
54 } | 59 } |
55 | 60 |
56 /* 2. aligned */ | 61 /* 2. aligned */ |
57 for (i = 3; i < N-1; i++) | 62 for (i = NINTS - 1; i < N - 1; i++) |
58 { | 63 { |
59 tmp1[2].a.n[1][2][i] = 6; | 64 tmp1[2].a.n[1][2][i] = 6; |
60 } | 65 } |
61 | 66 |
62 /* check results: */ | 67 /* check results: */ |
63 for (i = 3; i < N-1; i++) | 68 for (i = NINTS; i < N - 1; i++) |
64 { | 69 { |
65 if (tmp1[2].a.n[1][2][i] != 6) | 70 if (tmp1[2].a.n[1][2][i] != 6) |
66 abort (); | 71 abort (); |
67 } | 72 } |
68 | 73 |
84 abort (); | 89 abort (); |
85 } | 90 } |
86 } | 91 } |
87 | 92 |
88 /* 4. unaligned (unknown misalignment) */ | 93 /* 4. unaligned (unknown misalignment) */ |
89 for (i = 0; i < N-4; i++) | 94 for (i = 0; i < N - NINTS; i++) |
90 { | 95 { |
91 for (j = 0; j < N-4; j++) | 96 for (j = 0; j < N - NINTS; j++) |
92 { | 97 { |
93 tmp2[2].e.n[1][i][j] = 8; | 98 tmp2[2].e.n[1][i][j] = 8; |
94 } | 99 } |
95 } | 100 } |
96 | 101 |
97 /* check results: */ | 102 /* check results: */ |
98 for (i = 0; i < N-4; i++) | 103 for (i = 0; i < N - NINTS; i++) |
99 { | 104 { |
100 for (j = 0; j < N-4; j++) | 105 for (j = 0; j < N - NINTS; j++) |
101 { | 106 { |
102 if (tmp2[2].e.n[1][i][j] != 8) | 107 if (tmp2[2].e.n[1][i][j] != 8) |
103 abort (); | 108 abort (); |
104 } | 109 } |
105 } | 110 } |
112 check_vect (); | 117 check_vect (); |
113 | 118 |
114 return main1 (); | 119 return main1 (); |
115 } | 120 } |
116 | 121 |
117 /* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */ | 122 /* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" { target vect_hw_misalign } } } */ |
118 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */ | 123 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target { ! vect_hw_misalign } } } } */ |
124 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { { ! vector_alignment_reachable } && { ! vect_hw_misalign } } } } } */ |