2018-05-15 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr78408-1.c
blob94e2090b374faa2c00c46afb17ca0f2e7a0f7abc
1 /* PR c/78408 */
2 /* { dg-do compile { target size32plus } } */
3 /* { dg-options "-O2 -fdump-tree-fab1-details" } */
4 /* { dg-final { scan-tree-dump-times "after previous" 17 "fab1" } } */
6 struct S { char a[32]; };
7 struct T { char a[65536]; };
8 void bar (int, struct S *, struct S *, struct T *, struct T *);
9 void baz (char *, char *);
11 void
12 f1 (void)
14 struct S a, b;
15 struct T c, d;
16 a = b = (struct S) {};
17 c = d = (struct T) {};
18 bar (1, &a, &b, &c, &d);
21 void
22 f2 (void)
24 struct S a, b;
25 struct T c, d;
26 b = (struct S) {};
27 a = b;
28 d = (struct T) {};
29 c = d;
30 bar (2, &a, &b, &c, &d);
33 void
34 f3 (void)
36 struct S a, b;
37 struct T c, d;
38 __builtin_memset (&b, 0, sizeof (b));
39 a = b;
40 __builtin_memset (&d, 0, sizeof (d));
41 c = d;
42 bar (3, &a, &b, &c, &d);
46 void
47 f4 (void)
49 struct S a, b;
50 struct T c, d;
51 b = (struct S) {};
52 __builtin_memcpy (&a, &b, sizeof (b));
53 d = (struct T) {};
54 __builtin_memcpy (&c, &d, sizeof (d));
55 bar (4, &a, &b, &c, &d);
58 void
59 f5 (void)
61 struct S a, b;
62 struct T c, d;
63 __builtin_memset (&b, 0, sizeof (b));
64 __builtin_memcpy (&a, &b, sizeof (b));
65 __builtin_memset (&d, 0, sizeof (d));
66 __builtin_memcpy (&c, &d, sizeof (d));
67 bar (5, &a, &b, &c, &d);
70 void
71 f6 (void)
73 struct S a, b, e, g;
74 struct T c, d, f, h;
75 g = e = a = b = (struct S) {};
76 h = f = c = d = (struct T) {};
77 bar (6, &a, &b, &c, &d);
78 bar (6, &e, &g, &f, &h);
81 void
82 f7 (void)
84 char a[64], b[64];
85 __builtin_memset (a + 13, 2, 27);
86 __builtin_memcpy (b + 4, a + 17, 23);
87 baz (a, b);