2 /* { dg-require-effective-target store_merge } */
3 /* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-store-merging" } */
5 struct S
{ unsigned char a
, b
; unsigned short c
; unsigned char d
, e
, f
, g
; unsigned long long h
; };
7 __attribute__((noipa
)) void
19 __attribute__((noipa
)) void
20 f2 (struct S
*__restrict p
, struct S
*__restrict q
)
31 __attribute__((noipa
)) void
32 f3 (struct S
*p
, struct S
*q
)
34 unsigned char pa
= q
->a
;
35 unsigned char pb
= q
->b
;
36 unsigned short pc
= q
->c
;
37 unsigned char pd
= q
->d
;
38 unsigned char pe
= q
->e
;
39 unsigned char pf
= q
->f
;
40 unsigned char pg
= q
->g
;
50 __attribute__((noipa
)) void
51 f4 (struct S
*p
, struct S
*q
)
53 unsigned char pa
= p
->a
| q
->a
;
54 unsigned char pb
= p
->b
| q
->b
;
55 unsigned short pc
= p
->c
| q
->c
;
56 unsigned char pd
= p
->d
| q
->d
;
57 unsigned char pe
= p
->e
| q
->e
;
58 unsigned char pf
= p
->f
| q
->f
;
59 unsigned char pg
= p
->g
| q
->g
;
69 __attribute__((noipa
)) void
70 f5 (struct S
*p
, struct S
*q
)
72 unsigned char pa
= p
->a
& q
->a
;
73 unsigned char pb
= p
->b
& q
->b
;
74 unsigned short pc
= p
->c
& q
->c
;
75 unsigned char pd
= p
->d
& q
->d
;
76 unsigned char pe
= p
->e
& q
->e
;
77 unsigned char pf
= p
->f
& q
->f
;
78 unsigned char pg
= p
->g
& q
->g
;
88 __attribute__((noipa
)) void
89 f6 (struct S
*p
, struct S
*q
)
91 unsigned char pa
= p
->a
^ q
->a
;
92 unsigned char pb
= p
->b
^ q
->b
;
93 unsigned short pc
= p
->c
^ q
->c
;
94 unsigned char pd
= p
->d
^ q
->d
;
95 unsigned char pe
= p
->e
^ q
->e
;
96 unsigned char pf
= p
->f
^ q
->f
;
97 unsigned char pg
= p
->g
^ q
->g
;
107 __attribute__((noipa
)) void
108 f7 (struct S
*__restrict p
, struct S
*__restrict q
)
119 __attribute__((noipa
)) void
120 f8 (struct S
*__restrict p
, struct S
*__restrict q
)
131 __attribute__((noipa
)) void
132 f9 (struct S
*__restrict p
, struct S
*__restrict q
)
143 __attribute__((noipa
)) void
144 f10 (struct S
*__restrict p
, struct S
*__restrict q
)
155 __attribute__((noipa
)) void
156 f11 (struct S
*__restrict p
, struct S
*__restrict q
)
158 p
->a
= p
->a
| (unsigned char) ~q
->a
;
159 p
->b
= p
->b
| (unsigned char) ~q
->b
;
160 p
->c
= p
->c
| (unsigned short) ~q
->c
;
161 p
->d
= p
->d
| (unsigned char) ~q
->d
;
162 p
->e
= p
->e
| (unsigned char) ~q
->e
;
163 p
->f
= p
->f
| (unsigned char) ~q
->f
;
164 p
->g
= p
->g
| (unsigned char) ~q
->g
;
167 __attribute__((noipa
)) void
168 f12 (struct S
*__restrict p
, struct S
*__restrict q
)
170 p
->a
= p
->a
& (unsigned char) ~q
->a
;
171 p
->b
= p
->b
& (unsigned char) ~q
->b
;
172 p
->c
= p
->c
& (unsigned short) ~q
->c
;
173 p
->d
= p
->d
& (unsigned char) ~q
->d
;
174 p
->e
= p
->e
& (unsigned char) ~q
->e
;
175 p
->f
= p
->f
& (unsigned char) ~q
->f
;
176 p
->g
= p
->g
& (unsigned char) ~q
->g
;
179 __attribute__((noipa
)) void
180 f13 (struct S
*__restrict p
, struct S
*__restrict q
)
182 p
->a
= p
->a
^ (unsigned char) ~q
->a
;
183 p
->b
= p
->b
^ (unsigned char) ~q
->b
;
184 p
->c
= p
->c
^ (unsigned short) ~q
->c
;
185 p
->d
= p
->d
^ (unsigned char) ~q
->d
;
186 p
->e
= p
->e
^ (unsigned char) ~q
->e
;
187 p
->f
= p
->f
^ (unsigned char) ~q
->f
;
188 p
->g
= p
->g
^ (unsigned char) ~q
->g
;
191 struct S s
= { 20, 21, 22, 23, 24, 25, 26, 27 };
192 struct S t
= { 0x71, 0x72, 0x7f04, 0x78, 0x31, 0x32, 0x34, 0xf1f2f3f4f5f6f7f8ULL
};
193 struct S u
= { 28, 29, 30, 31, 32, 33, 34, 35 };
194 struct S v
= { 36, 37, 38, 39, 40, 41, 42, 43 };
199 asm volatile ("" : : : "memory");
201 asm volatile ("" : : : "memory");
202 if (s
.a
!= 1 || s
.b
!= 2 || s
.c
!= 3 || s
.d
!= 4
203 || s
.e
!= 5 || s
.f
!= 6 || s
.g
!= 7 || s
.h
!= 27)
206 asm volatile ("" : : : "memory");
207 if (s
.a
!= 28 || s
.b
!= 29 || s
.c
!= 30 || s
.d
!= 31
208 || s
.e
!= 32 || s
.f
!= 33 || s
.g
!= 34 || s
.h
!= 27)
211 asm volatile ("" : : : "memory");
212 if (s
.a
!= 36 || s
.b
!= 37 || s
.c
!= 38 || s
.d
!= 39
213 || s
.e
!= 40 || s
.f
!= 41 || s
.g
!= 42 || s
.h
!= 27)
216 asm volatile ("" : : : "memory");
217 if (s
.a
!= (36 | 0x71) || s
.b
!= (37 | 0x72)
218 || s
.c
!= (38 | 0x7f04) || s
.d
!= (39 | 0x78)
219 || s
.e
!= (40 | 0x31) || s
.f
!= (41 | 0x32)
220 || s
.g
!= (42 | 0x34) || s
.h
!= 27)
224 asm volatile ("" : : : "memory");
225 if (s
.a
!= (28 & 0x71) || s
.b
!= (29 & 0x72)
226 || s
.c
!= (30 & 0x7f04) || s
.d
!= (31 & 0x78)
227 || s
.e
!= (32 & 0x31) || s
.f
!= (33 & 0x32)
228 || s
.g
!= (34 & 0x34) || s
.h
!= 27)
232 asm volatile ("" : : : "memory");
233 if (s
.a
!= (36 ^ 0x71) || s
.b
!= (37 ^ 0x72)
234 || s
.c
!= (38 ^ 0x7f04) || s
.d
!= (39 ^ 0x78)
235 || s
.e
!= (40 ^ 0x31) || s
.f
!= (41 ^ 0x32)
236 || s
.g
!= (42 ^ 0x34) || s
.h
!= 27)
240 asm volatile ("" : : : "memory");
241 if (s
.a
!= (36 | 0x71) || s
.b
!= (37 | 0x72)
242 || s
.c
!= (38 | 0x7f04) || s
.d
!= (39 | 0x78)
243 || s
.e
!= (40 | 0x31) || s
.f
!= (41 | 0x32)
244 || s
.g
!= (42 | 0x34) || s
.h
!= 27)
248 asm volatile ("" : : : "memory");
249 if (s
.a
!= (28 & 0x71) || s
.b
!= (29 & 0x72)
250 || s
.c
!= (30 & 0x7f04) || s
.d
!= (31 & 0x78)
251 || s
.e
!= (32 & 0x31) || s
.f
!= (33 & 0x32)
252 || s
.g
!= (34 & 0x34) || s
.h
!= 27)
256 asm volatile ("" : : : "memory");
257 if (s
.a
!= (36 ^ 0x71) || s
.b
!= (37 ^ 0x72)
258 || s
.c
!= (38 ^ 0x7f04) || s
.d
!= (39 ^ 0x78)
259 || s
.e
!= (40 ^ 0x31) || s
.f
!= (41 ^ 0x32)
260 || s
.g
!= (42 ^ 0x34) || s
.h
!= 27)
263 asm volatile ("" : : : "memory");
264 if (s
.a
!= (unsigned char) ~28 || s
.b
!= (unsigned char) ~29
265 || s
.c
!= (unsigned short) ~30 || s
.d
!= (unsigned char) ~31
266 || s
.e
!= (unsigned char) ~32 || s
.f
!= (unsigned char) ~33
267 || s
.g
!= (unsigned char) ~34 || s
.h
!= 27)
271 asm volatile ("" : : : "memory");
272 if (s
.a
!= (36 | (unsigned char) ~0x71) || s
.b
!= (37 | (unsigned char) ~0x72)
273 || s
.c
!= (38 | (unsigned short) ~0x7f04) || s
.d
!= (39 | (unsigned char) ~0x78)
274 || s
.e
!= (40 | (unsigned char) ~0x31) || s
.f
!= (41 | (unsigned char) ~0x32)
275 || s
.g
!= (42 | (unsigned char) ~0x34) || s
.h
!= 27)
279 asm volatile ("" : : : "memory");
280 if (s
.a
!= (28 & (unsigned char) ~0x71) || s
.b
!= (29 & (unsigned char) ~0x72)
281 || s
.c
!= (30 & (unsigned short) ~0x7f04) || s
.d
!= (31 & (unsigned char) ~0x78)
282 || s
.e
!= (32 & (unsigned char) ~0x31) || s
.f
!= (33 & (unsigned char) ~0x32)
283 || s
.g
!= (34 & (unsigned char) ~0x34) || s
.h
!= 27)
287 asm volatile ("" : : : "memory");
288 if (s
.a
!= (36 ^ (unsigned char) ~0x71) || s
.b
!= (37 ^ (unsigned char) ~0x72)
289 || s
.c
!= (38 ^ (unsigned short) ~0x7f04) || s
.d
!= (39 ^ (unsigned char) ~0x78)
290 || s
.e
!= (40 ^ (unsigned char) ~0x31) || s
.f
!= (41 ^ (unsigned char) ~0x32)
291 || s
.g
!= (42 ^ (unsigned char) ~0x34) || s
.h
!= 27)
296 /* { dg-final { scan-tree-dump-times "Merging successful" 13 "store-merging" } } */