1 /* { dg-do compile } */
2 /* { dg-require-effective-target store_merge } */
3 /* { dg-options "-O2 -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 struct S s
= { 20, 21, 22, 23, 24, 25, 26, 27 };
108 struct S t
= { 0x71, 0x72, 0x7f04, 0x78, 0x31, 0x32, 0x34, 0xf1f2f3f4f5f6f7f8ULL
};
109 struct S u
= { 28, 29, 30, 31, 32, 33, 34, 35 };
110 struct S v
= { 36, 37, 38, 39, 40, 41, 42, 43 };
115 asm volatile ("" : : : "memory");
117 asm volatile ("" : : : "memory");
118 if (s
.a
!= 1 || s
.b
!= 2 || s
.c
!= 3 || s
.d
!= 4
119 || s
.e
!= 5 || s
.f
!= 6 || s
.g
!= 7 || s
.h
!= 27)
122 asm volatile ("" : : : "memory");
123 if (s
.a
!= 28 || s
.b
!= 29 || s
.c
!= 30 || s
.d
!= 31
124 || s
.e
!= 32 || s
.f
!= 33 || s
.g
!= 34 || s
.h
!= 27)
127 asm volatile ("" : : : "memory");
128 if (s
.a
!= 36 || s
.b
!= 37 || s
.c
!= 38 || s
.d
!= 39
129 || s
.e
!= 40 || s
.f
!= 41 || s
.g
!= 42 || s
.h
!= 27)
132 asm volatile ("" : : : "memory");
133 if (s
.a
!= (36 | 0x71) || s
.b
!= (37 | 0x72)
134 || s
.c
!= (38 | 0x7f04) || s
.d
!= (39 | 0x78)
135 || s
.e
!= (40 | 0x31) || s
.f
!= (41 | 0x32)
136 || s
.g
!= (42 | 0x34) || s
.h
!= 27)
140 asm volatile ("" : : : "memory");
141 if (s
.a
!= (28 & 0x71) || s
.b
!= (29 & 0x72)
142 || s
.c
!= (30 & 0x7f04) || s
.d
!= (31 & 0x78)
143 || s
.e
!= (32 & 0x31) || s
.f
!= (33 & 0x32)
144 || s
.g
!= (34 & 0x34) || s
.h
!= 27)
148 asm volatile ("" : : : "memory");
149 if (s
.a
!= (36 ^ 0x71) || s
.b
!= (37 ^ 0x72)
150 || s
.c
!= (38 ^ 0x7f04) || s
.d
!= (39 ^ 0x78)
151 || s
.e
!= (40 ^ 0x31) || s
.f
!= (41 ^ 0x32)
152 || s
.g
!= (42 ^ 0x34) || s
.h
!= 27)
157 /* { dg-final { scan-tree-dump-times "Merging successful" 6 "store-merging" } } */