blob: c4226ef01afb7c24e8a3f5eee32c4e3ba84bf51c (
plain)
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
|
/* { dg-do compile } */
/* { dg-options "-O1 -fno-tree-reassoc -fdump-tree-optimized-raw" } */
_Bool f(int a, int b)
{
_Bool c = a == b;
_Bool d = a > b;
return c | d;
}
_Bool f1(int a, int b)
{
_Bool c = a != b;
_Bool d = a >= b;
return c & d;
}
_Bool g(int a, int b)
{
_Bool c = a == b;
_Bool d = a < b;
return c | d;
}
_Bool g1(int a, int b)
{
_Bool c = a != b;
_Bool d = a <= b;
return c & d;
}
/* We should be able to optimize these without reassociation too. */
/* { dg-final { scan-tree-dump-not "bit_and_expr," "optimized" } } */
/* { dg-final { scan-tree-dump-not "bit_ior_expr," "optimized" } } */
/* { dg-final { scan-tree-dump-times "gt_expr," 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "ge_expr," 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "lt_expr," 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "le_expr," 1 "optimized" } } */
|