summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/scev-5.c
blob: 8cced512e8d0eca706120febd47fffc439bd4de1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* { dg-do compile } */
/* { dg-options "-O2 -fgimple -fdump-tree-ivopts" } */

int *a_p;
int a[1000];

void __GIMPLE (startwith ("loop"))
f (int k)
{
  long long int i;
  int * _1;

bb_2:
  i_5 = (long long int) k_4(D);
  if (i_5 <= 999ll)
    goto bb_4;
  else
    goto bb_3;

bb_3:
  return;

bb_4:
  ;

bb_5:
  i_12 = __PHI (bb_6: i_9, bb_4: i_5);
  _1 = &a[i_12];
  a_p = _1;
  __MEM <int[1000]> ((int *)&a)[i_12] = 100;
  i_9 = i_5 + i_12;
  if (i_9 <= 999ll)
    goto bb_6;
  else
    goto bb_3;

bb_6:
  ;
  goto bb_5;

}

/* { dg-final { scan-tree-dump-times "&a" 1 "ivopts" } } */