1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 /* PR tree-optimization/117776 */
6 /* These 2 functions should be optimized to just `return 1;`
7 as `(int)(unsigned smaller)medium` is the same as
8 `(int)medium&smaller_mask` where smaller_mask in this case is
9 either `1` (_Bool) or `0xff` (char). */
10 int f(unsigned char a
)
12 _Bool odd
= (a
& 1) != 0;
13 int odd1
= (a
& 1) != 0;
16 int g(unsigned short a
)
20 unsigned short c
= a
&0xff;
25 /* { dg-final { scan-tree-dump-times "return 1" 2 "optimized" } } */