| 1 |
/* PR tree-optimization/90693 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2 -mno-abm -mno-popcnt -fdump-tree-optimized" } */ |
| 4 |
/* { dg-final { scan-tree-dump-not "POPCOUNT \\\(" "optimized" } } */ |
| 5 |
/* { dg-final { scan-tree-dump-not "__builtin_popcount(ll)? \\\(" "optimized" } } */ |
| 6 |
|
| 7 |
int |
| 8 |
foo (unsigned int x) |
| 9 |
{ |
| 10 |
if (x == 0) |
| 11 |
__builtin_unreachable (); |
| 12 |
return __builtin_popcount (x) == 1; |
| 13 |
} |
| 14 |
|
| 15 |
int |
| 16 |
bar (unsigned int x) |
| 17 |
{ |
| 18 |
return (x & (x - 1)) == 0; |
| 19 |
} |
| 20 |
|
| 21 |
int |
| 22 |
baz (unsigned long long x) |
| 23 |
{ |
| 24 |
if (x == 0) |
| 25 |
__builtin_unreachable (); |
| 26 |
return __builtin_popcountll (x) == 1; |
| 27 |
} |
| 28 |
|
| 29 |
int |
| 30 |
qux (unsigned long long x) |
| 31 |
{ |
| 32 |
return (x & (x - 1)) == 0; |
| 33 |
} |