aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/data-dep-1.c
blob: 5eb71d9be9efa930821d81e7b7f96de602168cca (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
/* { dg-do compile } */ 
/* { dg-skip-if "too much code for avr" { "avr-*-*" } { "*" } { "" } } */
/* { dg-options "-O2 -ftree-loop-linear -fdump-tree-ltrans-all" } */

int foo (int n, int m)
{
  int a[10000][10000];
  int i, j, k;

  for(k = 0; k < 1234; k++)
    for(j = 0; j < 5; j++)
      for(i = 0; i < 67; i++)
	{
	  a[j+i-(-m+n+3)][i-k+4] = a[k+j][i];
	}

  return a[0][0];
}


/* For the data dependence analysis of the outermost loop, the
   evolution of "k+j" should be instantiated in the outermost loop "k"
   and the evolution should be taken in the innermost loop "i".  The
   pattern below ensures that the evolution is not computed in the
   outermost "k" loop: the 4 comes from the instantiation of the
   number of iterations of loop "j".  */

/* { dg-final { scan-tree-dump-times "4, \\+, 1" 0 "ltrans" } } */ 
/* { dg-final { cleanup-tree-dump "ltrans" } } */