1 /* { dg-do compile } */ 2 /* Note PRE and DOM jump threading rotate the loop and blocks the sinking opportunity. */ 3 /* { dg-options "-O2 -fno-tree-pre -fno-tree-dominator-opts -fdump-tree-sink -fdump-tree-optimized" } */ 4 f(int n)5int f(int n) 6 { 7 int i,j=0; 8 for (i = 0; i < 31; i++) 9 j = __builtin_ffs(i); 10 return j; 11 } 12 13 /* { dg-final { scan-tree-dump "Sinking j_. = __builtin_ffs" "sink" } } */ 14 /* { dg-final { scan-tree-dump "return 2;" "optimized" } } */ 15