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


int bar (void);

int foo ()
{
  int a = -100;
  int b = 2;
  int c = 3;
  int d = 4;
  
  while (a)
    {
      a = a + b;
      
      /* Exercises if-phi-nodes.  */
      if (bar ())
	b = b + c;
      
      c = c + d;
    }
}

/* The analyzer has to detect the following evolution functions:
   c  ->  {3, +, 4}_1
   b  ->  {2, +, {[0, 3], +, [0, 4]}_1}_1
   a  ->  {-100, +, {2, +, {[0, 3], +, [0, 4]}_1}_1}_1
*/

/* FIXME. */