aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/pr58404.C
blob: aa8fb796c6f81f4639520c684b0dd0201cc413a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// { dg-do compile }
// { dg-options "-O -fdump-tree-cddce1" }

struct S { int s; };
S a[1024];

void
foo ()
{
  for (int i = 0; i < 1024; i++)
    {
      S &r = a[i];
      r.s++;
    }
}

// We should propagate the reference into both memory accesses
// during the first forwprop pass
// { dg-final { scan-tree-dump-times "= &a" 0 "cddce1" } }
// { dg-final { cleanup-tree-dump "cddce1" } }