aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-15.c
blob: 5efb95627ee6b743d8f2a4dd07e7c260d2ee5cf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* PR/101293 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-lim2-details" } */

struct X { int i; int j; };

void foo(struct X *x, int n)
{
  for (int i = 0; i < n; ++i)
    {
      int *p = &x->j;
      int tem = *p;
      x->j += tem * i;
    }
}

/* Make sure LIM can handle unifying MEM[x, 4] and MEM[x].j  */
/* { dg-final { scan-tree-dump "Executing store motion" "lim2" } } */