summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr38895.c
blob: 0a96e53348aeac11886e0920a80a64fec44d3f4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* { dg-do compile } */
/* { dg-options "-O -fstrict-aliasing -fdump-tree-optimized" } */

struct A {
  int i;
  int j;
};
struct B {
  struct A a1;
  struct A a2;
};
struct C {
  struct A a1;
  struct B b;
};
int foo(struct C *c, struct B *b)
{
  c->a1.i = 1;
  b->a1.i = 0;
  return c->a1.i;
}

/* { dg-final { scan-tree-dump "return 1;" "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */