| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-tree-optimized" } */ |
| 3 |
|
| 4 |
int foo(unsigned short x) |
| 5 |
{ |
| 6 |
unsigned short t1 = __builtin_bswap16(x); |
| 7 |
unsigned int t2 = t1; |
| 8 |
return __builtin_popcount (t2); |
| 9 |
} |
| 10 |
|
| 11 |
int fool(unsigned short x) |
| 12 |
{ |
| 13 |
unsigned short t1 = __builtin_bswap16(x); |
| 14 |
unsigned long t2 = t1; |
| 15 |
return __builtin_popcountl (t2); |
| 16 |
} |
| 17 |
|
| 18 |
int fooll(unsigned short x) |
| 19 |
{ |
| 20 |
unsigned short t1 = __builtin_bswap16(x); |
| 21 |
unsigned long long t2 = t1; |
| 22 |
return __builtin_popcountll (t2); |
| 23 |
} |
| 24 |
|
| 25 |
/* { dg-final { scan-tree-dump-not "bswap" "optimized" } } */ |