Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.dg / store_merging_24.c
blob5291bb9e98640d9670331a03235f43ee3d133891
1 /* PR tree-optimization/87859 */
2 /* { dg-do run } */
3 /* { dg-options "-O2 -fno-tree-vectorize -fdump-tree-store-merging-details" } */
4 /* { dg-final { scan-tree-dump "New sequence of \[23] stores to replace old one of 19 stores" "store-merging" { target i?86-*-* x86_64-*-* } } } */
5 /* { dg-final { scan-tree-dump "New sequence of 1 stores to replace old one of 6 stores" "store-merging" { target i?86-*-* x86_64-*-* } } } */
7 struct S {
8 union F {
9 struct T {
10 #define A(n) unsigned n:1;
11 #define B(n) A(n##0) A(n##1) A(n##2) A(n##3) A(n##4) \
12 A(n##5) A(n##6) A(n##7) A(n##8) A(n##9)
13 B(f) B(f1) B(f2) B(f3) B(f4) B(f5)
14 A(f60) A(f61) A(f62) A(f63) A(f64) A(f65) A(f66)
15 } q;
16 unsigned int i[3];
17 } f;
20 struct S s = {
21 .f.q.f0 = 1, .f.q.f1 = 1, .f.q.f2 = 1, .f.q.f5 = 1, .f.q.f6 = 1,
22 .f.q.f7 = 1, .f.q.f8 = 1, .f.q.f9 = 1, .f.q.f13 = 1, .f.q.f14 = 1,
23 .f.q.f15 = 1, .f.q.f16 = 1, .f.q.f17 = 1, .f.q.f19 = 1, .f.q.f21 = 1,
24 .f.q.f66 = 1
27 __attribute__((noipa)) void
28 bar (unsigned *x)
30 if (x[0] != s.f.i[0] || x[1] != s.f.i[1] || x[2] != s.f.i[2])
31 __builtin_abort ();
34 __attribute__((noipa)) void
35 foo (unsigned char *state)
37 struct S i;
38 i.f.i[0] = 0;
39 i.f.i[1] = 0;
40 i.f.i[2] = 0;
41 i.f.q.f7 = 1;
42 i.f.q.f2 = 1;
43 i.f.q.f21 = 1;
44 i.f.q.f19 = 1;
45 i.f.q.f14 = 1;
46 i.f.q.f5 = 1;
47 i.f.q.f0 = 1;
48 i.f.q.f15 = 1;
49 i.f.q.f16 = 1;
50 i.f.q.f6 = 1;
51 i.f.q.f9 = 1;
52 i.f.q.f17 = 1;
53 i.f.q.f1 = 1;
54 i.f.q.f8 = 1;
55 i.f.q.f13 = 1;
56 i.f.q.f66 = 1;
57 if (*state)
59 i.f.q.f37 = 1;
60 i.f.q.f38 = 1;
61 i.f.q.f39 = 1;
62 i.f.q.f40 = 1;
63 i.f.q.f41 = 1;
64 i.f.q.f36 = 1;
66 bar (i.f.i);
69 int
70 main ()
72 unsigned char z = 0;
73 foo (&z);
74 return 0;