| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-additional-options "-fgimple -fdump-tree-optimized" } */ |
| 3 |
/* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */ |
| 4 |
/* PR tree-optimization/125774 */ |
| 5 |
|
| 6 |
__attribute__((noipa)) |
| 7 |
_Bool __GIMPLE (ssa,startwith("dom2")) |
| 8 |
f (int a, int b) |
| 9 |
{ |
| 10 |
_Bool _3; |
| 11 |
_Bool _4; |
| 12 |
_Bool _5; |
| 13 |
|
| 14 |
__BB(2): |
| 15 |
_3 = a_1(D) > b_2(D); |
| 16 |
_4 = b_2(D) > a_1(D); |
| 17 |
_5 = _3 | _4; |
| 18 |
return _5; |
| 19 |
} |
| 20 |
|
| 21 |
__attribute__((noipa)) |
| 22 |
_Bool __GIMPLE (ssa,startwith("dom2")) |
| 23 |
f1 (int a, int b) |
| 24 |
{ |
| 25 |
_Bool _3; |
| 26 |
_Bool _4; |
| 27 |
_Bool _5; |
| 28 |
|
| 29 |
__BB(2): |
| 30 |
_3 = a_1(D) > b_2(D); |
| 31 |
_4 = a_1(D) < b_2(D); |
| 32 |
_5 = _3 | _4; |
| 33 |
return _5; |
| 34 |
} |
| 35 |
|
| 36 |
int main() |
| 37 |
{ |
| 38 |
int a = 10, b = 10; |
| 39 |
if (f(a,b)) |
| 40 |
__builtin_abort(); |
| 41 |
if (f1(a,b)) |
| 42 |
__builtin_abort(); |
| 43 |
return 0; |
| 44 |
} |
| 45 |
|
| 46 |
/* { dg-final { scan-tree-dump-not "return 1" "optimized" } } */ |
| 47 |
/* Both functions should be optimized to `a_1 != b_2`. */ |
| 48 |
/* { dg-final { scan-tree-dump-times "a_1.D. != b_2.D." 2 "optimized" { target __OPTIMIZE__ } } } */ |