aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-16.c
blob: 012b165fbab71fdabdf9b7c51604e7728f7739d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* { dg-do compile } */
/* Note PRE and DOM jump threading rotate the loop and blocks the sinking opportunity.  */
/* { dg-options "-O2 -fno-tree-pre -fno-tree-dominator-opts -fdump-tree-sink -fdump-tree-optimized" } */

int f(int n)
{
  int i,j=0;
  for (i = 0; i < 31; i++)
    j = __builtin_ffs(i);
  return j;
}

/* { dg-final { scan-tree-dump "Sinking j_. = __builtin_ffs" "sink1" } } */
/* { dg-final { scan-tree-dump "return 2;" "optimized" } } */