Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/cmpeq-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized-raw" } */
3 /* PR tree-optimization/109959 */
4
5 unsigned fu(unsigned a)
6 {
7 _Bool t = a <= 1;
8 return t & a;
9 }
10
11 _Bool fb(unsigned a)
12 {
13 _Bool t = a <= 1;
14 return t & a;
15 }
16
17 _Bool fb1(unsigned a)
18 {
19 _Bool t = a <= 1;
20 _Bool t1 = a;
21 return t & t1;
22 }
23
24 signed fui(unsigned a)
25 {
26 _Bool t = a <= 1;
27 int ai = a;
28 return t & ai;
29 }
30
31 /* These all should be optimized to `a == 1` */
32 /* { dg-final { scan-tree-dump-times "eq_expr," 4 "optimized"} } */
33 /* { dg-final { scan-tree-dump-not "le_expr," "optimized"} } */
34 /* { dg-final { scan-tree-dump-not "bit_and_expr," "optimized"} } */
35
36