aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-20.c
blob: 521f60efe52d235515ca15c0a606c2325f10d53c (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-options "-O1 -fscalar-evolutions -fdump-tree-scev-details" } */


int main ()
{
  int a = 3;
  int b = 2;
  
  while (a)
    {
      b += 5;
      a += b;
      
      /* Exercises the sum of a polynomial of degree 2 with an
	 evolution of degree 1:
	 
	 (loop_num = 1, chrec_var = {3, +, 7, +, 5}, to_add = 2).
	 The result should be:  {3, +, 9, +, 5}.  */
      a += 2;
    }
}

/* 
   b  ->  {2, +, 5}_1
   a  ->  {3, +, {9, +, 5}_1}_1
*/

/* FIXME. */