| 1 |
/* PR tree-optimization/94956 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2" } */ |
| 4 |
/* { dg-final { scan-assembler-not "\tcmovne\t" } } */ |
| 5 |
/* { dg-final { scan-assembler-not "\tsete\t" } } */ |
| 6 |
|
| 7 |
int |
| 8 |
foo (unsigned x) |
| 9 |
{ |
| 10 |
if (x == 0) __builtin_unreachable (); |
| 11 |
return __builtin_ffs (x) - 1; |
| 12 |
} |
| 13 |
|
| 14 |
int |
| 15 |
bar (unsigned long x) |
| 16 |
{ |
| 17 |
if (x == 0) __builtin_unreachable (); |
| 18 |
return __builtin_ffsl (x) - 1; |
| 19 |
} |
| 20 |
|
| 21 |
#ifdef __x86_64__ |
| 22 |
int |
| 23 |
baz (unsigned long long x) |
| 24 |
{ |
| 25 |
if (x == 0) __builtin_unreachable (); |
| 26 |
return __builtin_ffsll (x) - 1; |
| 27 |
} |
| 28 |
#endif |