aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-35.c
blob: f33f28b397a87d85b83a09e5639a67697518038e (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
/* { dg-do compile } */ 
/* { dg-options "-O1 -fscalar-evolutions -fdump-tree-scev-details -fall-data-deps -fdump-tree-ddall" } */

#define L 100
#define M 100
#define N 100

int bar (float);

int foo (float A[][M][N])
{
  int i, j, k;
  
  for (i = 0; i < L; i++)
    for (j = 0; j < M; j++)
      for (k = 0; k < N; k++)
	A[i][j][j] = A[i][j][k];
  
  return bar (A[10][11][12]);
}

/* The following evolution functions have to be detected:
   
   i  ->  {0, +, 1}_1
   j  ->  {0, +, 1}_2
   k  ->  {0, +, 1}_3
   
   For the subscript [j] vs. [k], "{0, +, 1}_2"  vs.  "{0, +, 1}_3"
   the overlapping elements are respectively located at iterations:
   {0, +, 1}_3 and {0, +, 1}_2.
   
*/

/* { dg-final { diff-tree-dumps "ddall" } } */