| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-additional-options "-fno-tree-dse" } */ |
| 3 |
|
| 4 |
union U { long long i; long f; }; |
| 5 |
struct a {union U u;}; |
| 6 |
struct aa {struct a a;}; |
| 7 |
struct b {union U u;}; |
| 8 |
struct bb {struct b b;}; |
| 9 |
|
| 10 |
long __attribute__((noipa)) |
| 11 |
foo (struct bb *bv, void *ptr) |
| 12 |
{ |
| 13 |
struct aa *a = ptr; |
| 14 |
struct bb *b = ptr; |
| 15 |
bv->b.u.f = 1; |
| 16 |
a->a.u.i = 0; |
| 17 |
b->b.u.f = 0; |
| 18 |
return bv->b.u.f; |
| 19 |
} |
| 20 |
|
| 21 |
int |
| 22 |
main () |
| 23 |
{ |
| 24 |
union C {struct aa aa; struct bb bb;} v; |
| 25 |
if (foo (&v.bb, &v) != 0) |
| 26 |
__builtin_abort (); |
| 27 |
return 0; |
| 28 |
} |