aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-19.c
blob: e98d13fe85bbbfc9b2ff45f23d775f1e8f5265f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-sink1-details -fdump-tree-cddce2-details" } */

static int b=4;
int c;

int
main()
{
  int e[5] = {1,1,1,1,1};
  for (; b >= 0; b--) {
    c = e[b];
  }
  return 0;
}

/* We should sink e[b] out of the loop which is possible after
   applying store motion to c and b.  */
/* { dg-final { scan-tree-dump "Sinking # VUSE" "sink1" } } */
/* And remove the loop after final value replacement.  */
/* { dg-final { scan-tree-dump "fix_loop_structure: removing loop" "cddce2" } } */