aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/split-path-4.c
blob: 8ef7646282ce548369204e198a6017c610b42153 (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
/* { dg-do compile } */
/* { dg-options "-O2 -fsplit-paths -fdump-tree-split-paths-details -w -fdisable-tree-thread1 -fdisable-tree-thread2" } */

/* Note: Threader causes the infinite loop in val & 1 sooner.  */

powi_cost (long n)
{
  unsigned char cache[256];
  unsigned long digit;
  unsigned long val;
  int result;
  while (val >= 256)
    {
      if (val & 1)
	{
	  result += powi_lookup_cost (digit, cache) + 3 + 1;
	}
      else
	{
	  val >>= 1;
	}
    }
}

/* { dg-final { scan-tree-dump-times "Duplicating join block" 1 "split-paths" } } */