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
8 f1 (struct S
*__restrict p
, struct S
*__restrict q
)
19 __attribute__((noipa
)) void
20 f2 (struct S
*__restrict p
, struct S
*__restrict q
)
22 p
->a
= ~(unsigned char) (p
->a
& q
->a
);
23 p
->b
= ((unsigned char) ~p
->b
) & q
->b
;
24 p
->c
= p
->c
& (unsigned short) ~q
->c
;
26 p
->e
= p
->e
& (unsigned char) ~q
->e
;
27 p
->f
= p
->f
& (unsigned char) ~q
->f
;
28 p
->g
= ~(unsigned char) (p
->g
& q
->g
);
31 struct S s
= { 20, 21, 22, 23, 24, 25, 26, 27 };
32 struct S u
= { 28, 29, 30, 31, 32, 33, 34, 35 };
33 struct S v
= { 36, 37, 38, 39, 40, 41, 42, 43 };
38 asm volatile ("" : : : "memory");
40 asm volatile ("" : : : "memory");
41 if (s
.a
!= (unsigned char) ~28 || s
.b
!= 29
42 || s
.c
!= (unsigned short) ~30 || s
.d
!= (unsigned char) ~31
43 || s
.e
!= 32 || s
.f
!= (unsigned char) ~33 || s
.g
!= (unsigned char) ~34
47 asm volatile ("" : : : "memory");
48 if (u
.a
!= (unsigned char) ~(28 & 36) || u
.b
!= (((unsigned char) ~29) & 37)
49 || u
.c
!= (30 & (unsigned short) ~38) || u
.d
!= (31 & 39)
50 || u
.e
!= (32 & (unsigned char) ~40) || u
.f
!= (33 & (unsigned char) ~41)
51 || u
.g
!= (unsigned char) ~(34 & 42) || u
.h
!= 35)
56 /* { dg-final { scan-tree-dump-times "Merging successful" 2 "store-merging" } } */