| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-tree-optimized" } */ |
| 3 |
signed char f(unsigned char a) |
| 4 |
{ |
| 5 |
unsigned char b = a & 127; |
| 6 |
signed char c = (signed char) b; |
| 7 |
signed char d = (signed char) a; |
| 8 |
signed char e = d & -128; |
| 9 |
signed char h = c | e; |
| 10 |
return h; |
| 11 |
} |
| 12 |
/* The above should reduce down to just return with a cast. |
| 13 |
removing the two &s there and |'s. */ |
| 14 |
/* { dg-final { scan-tree-dump-times "& 127" 0 "optimized"} } */ |
| 15 |
/* { dg-final { scan-tree-dump-times "& -128" 0 "optimized"} } */ |
| 16 |
/* { dg-final { scan-tree-dump-times "\\\| " 0 "optimized"} } */ |