| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-tree-optimized" } */ |
| 3 |
unsigned char f(unsigned char a) |
| 4 |
{ |
| 5 |
signed char d = (signed char) a; |
| 6 |
signed char e = d & ~1; |
| 7 |
unsigned char t = e; |
| 8 |
t &= ~2; |
| 9 |
return t; |
| 10 |
} |
| 11 |
/* The above should reduce down to just & 252 rather than keping |
| 12 |
the two &s there. */ |
| 13 |
/* { dg-final { scan-tree-dump-times "& 252" 1 "optimized"} } */ |
| 14 |
/* { dg-final { scan-tree-dump-times "& -2" 0 "optimized"} } */ |
| 15 |
/* { dg-final { scan-tree-dump-times "& 253" 0 "optimized"} } */ |