Avoid expicit builtion list in tree-ssa-dce
[official-gcc.git] / gcc / testsuite / c-c++-common / pr51628-4.c
blobba88f5d0a39f642b87407ced48ea277a4a2220c6
1 /* PR c/51628. */
2 /* { dg-do compile } */
3 /* { dg-options "-O" } */
5 struct pair_t
7 int x;
8 int i;
9 } __attribute__((packed));
11 extern struct pair_t p;
12 extern int *x;
13 extern void bar (int *);
15 int *addr = &p.i;
16 /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
18 int *
19 foo (void)
21 struct pair_t arr[2] = { { 1, 10 }, { 2, 20 } };
22 int *p0, *p1;
23 p0 = &arr[0].i;
24 /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
25 bar (p0);
26 p1 = &arr[1].i;
27 /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
28 bar (p1);
29 bar (&p.i);
30 /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
31 x = &p.i;
32 /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
33 return &p.i;
34 /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */