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

struct Bar {
  int dom;
};
struct Foo {
  struct Bar doms[3];
};

int foo(int i, int j, int k)
{
  struct Foo f;

  f.doms[0].dom = i;
  f.doms[1].dom = j;
  f.doms[2].dom = k;
  return f.doms[0LL].dom;
}

/* { dg-final { scan-tree-dump "Replaced f.doms\\\[0\\\].dom with i_" "fre" } } */
/* { dg-final { cleanup-tree-dump "fre" } } */