Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/fold-xor-or.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fdump-tree-optimized --param logical-op-non-short-circuit=1" } */
3
4 typedef unsigned long int uint64_t;
5
6 int cmp1(int d1, int d2) {
7 if ((d1 ^ d2) == 0xabcd || d1 != d2)
8 return 0;
9 return 1;
10 }
11
12 int cmp2(int d1, int d2) {
13 if (d1 != d2 || (d1 ^ d2) == 0xabcd)
14 return 0;
15 return 1;
16 }
17
18 int cmp3(int d1, int d2) {
19 if (0xabcd > (d2 ^ d1) || d2 != d1)
20 return 0;
21 return 1;
22 }
23
24 int cmp4(int d1, int d2) {
25 if (d2 != d1 || 0xabcd > (d2 ^ d1))
26 return 0;
27 return 1;
28 }
29
30 int cmp1_64(uint64_t d1, uint64_t d2) {
31 if ((d1 ^ d2) == 0xabcd || d1 != d2)
32 return 0;
33 return 1;
34 }
35
36 int cmp2_64(uint64_t d1, uint64_t d2) {
37 if (d1 != d2 || (d1 ^ d2) == 0xabcd)
38 return 0;
39 return 1;
40 }
41
42 int cmp3_64(uint64_t d1, uint64_t d2) {
43 if (0xabcd > (d2 ^ d1) || d2 != d1)
44 return 0;
45 return 1;
46 }
47
48 int cmp4_64(uint64_t d1, uint64_t d2) {
49 if (d2 != d1 || 0xabcd > (d2 ^ d1))
50 return 0;
51 return 1;
52 }
53
54 /* The if should be removed, so the condition should not exist */
55 /* { dg-final { scan-tree-dump-not "d1_\[0-9\]+.D. \\^ d2_\[0-9\]+.D." "optimized" } } */