1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
/* PR tree-optimization/111150 */
/* { dg-do compile } */
/* { dg-options "-O1 -fgimple -fdump-tree-forwprop1-raw" } */
/* Checks if pattern (X ? e : f) == (Y ? e : f) gets optimized. */
__GIMPLE()
_Bool f1_(int a, int b, int c, int d, int e, int f) {
_Bool X;
_Bool Y;
_Bool t;
int t1;
int t2;
X = a == b;
Y = c == d;
/* Before the patch cond_expr was generated for these 2 statements. */
t1 = X ? e : f;
t2 = Y ? e : f;
t = t1 == t2;
return t;
}
/* Checks if pattern (X ? e : f) != (Y ? e : f) gets optimized. */
__GIMPLE()
_Bool f2_(int a, int b, int c, int d, int e, int f) {
_Bool X;
_Bool Y;
_Bool t;
int t1;
int t2;
X = a == b;
Y = c == d;
t1 = X ? e : f;
t2 = Y ? e : f;
t = t1 != t2;
return t;
}
/* Checks if pattern (X ? e : f) == (Y ? f : e) gets optimized. */
__GIMPLE()
_Bool f3_(int a, int b, int c, int d, int e, int f) {
_Bool X;
_Bool Y;
_Bool t;
int t1;
int t2;
X = a == b;
Y = c == d;
t1 = X ? e : f;
t2 = Y ? f : e;
t = t1 == t2;
return t;
}
/* Checks if pattern (X ? e : f) != (Y ? f : e) gets optimized. */
__GIMPLE()
_Bool f4_(int a, int b, int c, int d, int e, int f) {
_Bool X;
_Bool Y;
_Bool t;
int t1;
int t2;
X = a == b;
Y = c == d;
t1 = X ? e : f;
t2 = Y ? f : e;
t = t1 != t2;
return t;
}
/* Should generate one bit_xor_expr for each testcase. */
/* { dg-final { scan-tree-dump-not "cond_expr, " "forwprop1" } } */
/* 2 IOR, one each for f1 and f2.
2 AND, one each for f3 and f4. */
/* { dg-final { scan-tree-dump-times "bit_ior_expr, " 2 "forwprop1" } } */
/* { dg-final { scan-tree-dump-times "bit_and_expr, " 2 "forwprop1" } } */
/* { dg-final { scan-tree-dump-times "bit_xor_expr, " 4 "forwprop1" } } */
/* 8 eq comparisons from each of `a == b`/`c == d`.
2 more to check that `e == f`
2 ne comparisons to check that `e != f`. */
/* { dg-final { scan-tree-dump-times "<ne_expr, " 2 "forwprop1" } } */
/* { dg-final { scan-tree-dump-times "<eq_expr, " 10 "forwprop1" } } */
|