1 /* PR tree-optimization/116024 */
2 /* { dg-do compile } */
3 /* { dg-options "-O1 -fdump-tree-forwprop1-details" } */
12 int32_t l
= 10 - (int32_t)f();
13 return l
<= 9; // f() > 0
18 int32_t l
= 20 - (int32_t)f();
19 return l
<= INT32_MIN
; // return 0
24 int32_t l
= 30 - (int32_t)f();
25 return l
<= INT32_MIN
+ 31; // f() == INT32_MAX
30 int32_t l
= INT32_MAX
- 40 - (int32_t)f();
31 return l
<= -38; // f() > INT32_MAX - 3
36 int32_t l
= INT32_MAX
- 50 - (int32_t)f();
37 return l
<= INT32_MAX
- 1; // f() != -50
42 int32_t l
= INT32_MAX
- 60 - (int32_t)f();
43 return l
!= INT32_MAX
- 90; // f() != 30
48 int32_t l
= INT32_MIN
+ 70 - (int32_t)f();
49 return l
<= INT32_MAX
- 2; // return 0
54 int32_t l
= INT32_MAX
/2 + 30 - (int32_t)f();
55 return l
<= INT32_MIN
/2 - 30; // return 1
59 /* { dg-final { scan-tree-dump-times "Removing dead stmt:.*?- _" 5 "forwprop1" } } */
60 /* { dg-final { scan-tree-dump-times "return 0" 2 "forwprop1" } } */
61 /* { dg-final { scan-tree-dump-times "return 1" 1 "forwprop1" } } */
62 /* { dg-final { scan-tree-dump-times "gimple_simplified to.* > 0" 1 "forwprop1" } } */
63 /* { dg-final { scan-tree-dump-times "gimple_simplified to.* == 2147483647" 1 "forwprop1" } } */
64 /* { dg-final { scan-tree-dump-times "gimple_simplified to.* > 2147483644" 1 "forwprop1" } } */
65 /* { dg-final { scan-tree-dump-times "gimple_simplified to.* != 4294967246" 1 "forwprop1" } } */
66 /* { dg-final { scan-tree-dump-times "gimple_simplified to.* != 30" 1 "forwprop1" } } */