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


int bar (void);

int foo (int x)
{
  int a = -100;
  int b = 2;
  
  while (b)
    {
      if (x)
	a += 3;
      else
	a += bar ();
      
      /* Exercises the case when one of the branches of the if-phi-node cannot
	 be determined: [-oo, +oo].  
	 Since the evolution function is too difficult to handle in the expanded 
	 form, we have to keep it in its symbolic form:  "b  ->  {2, +, a_1}_1".  */
      b += a;
    }
}

/* a  ->  {-100, +, [min<t, 3>, max<t, 3>]}_1
   b  ->  {2, +, {[min<t, 3>, max<t, 3>] - 100, +, [min<t, 3>, max<t, 3>]}_1}_1
*/

/* FIXME. */