summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/alias-15.c
blob: 617af0fd154fabd1d173b1f6c928a68f6e05157a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do compile } */
/* { dg-options "-O -fno-early-inlining -fdump-tree-alias-vops-details" } */

struct foo {
  int a;
  struct X {
    int b[4];
  } b;
} m;
static inline struct X *wrap(struct X *p) { return p; }
int test2(void)
{
  struct X *p = wrap(&m.b);
  /* Both memory references need to alias the same tags.  */
  return p->b[3] - m.b.b[3];
}

/* { dg-final { scan-tree-dump-times "VUSE <m_.\\\(D\\\)>" 2 "alias" } } */
/* { dg-final { cleanup-tree-dump "alias" } } */