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

void bar (int);

#define N 100
#define NPad 10
#define M 32

void foo ()
{
  short coefs[2*M];
  short input[2*N];
  short output[2*N];
  
  int    sum_real, sum_imag;
  int    i,j,k;
  
  k = NPad;
  for (i = 0; i < N; i++) 
    {
      sum_real = 0;
      sum_imag = 0;
      for (j = 0; j < M; j++) 
	{
	  sum_real +=
	    input[2*k-2*j+1]*coefs[2*j+1] - input[2*k-2*j]*coefs[2*j];
	  
	  sum_imag +=
	    input[2*k-2*j]*coefs[2*j+1] + input[2*k-2*j+1]*coefs[2*j];
	}
      output[2*i+1] = sum_imag;
      output[2*i] = sum_real;
      k++; 
    }
  bar (sum_imag);
}

/* The following evolution functions have to be detected:
   
   i  ->  {0, +, 1}_1
   j  ->  {0, +, 1}_2

*/

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