1 /* PR tree-optimization/116024 */
2 /* { dg-do compile } */
3 /* { dg-options "-O1 -fdump-tree-forwprop1-details -fwrapv" } */
12 int32_t l
= -10 + (int32_t)f();
13 return l
<= INT32_MAX
- 10; // f() >= INT32_MIN + 10
18 int32_t l
= -20 + (int32_t)f();
19 return l
< INT32_MAX
- 19; // f() > INT32_MAX + 20
24 int32_t l
= 30 + (int32_t)f();
25 return l
>= INT32_MIN
+ 30; // f() <= INT32_MAX - 30
30 int32_t l
= 40 + (int32_t)f();
31 return l
> INT32_MIN
+ 39; // f() < INT32_MIN - 40
34 /* { dg-final { scan-tree-dump-times "Removing dead stmt:.*? \\+" 4 "forwprop1" } } */
35 /* { dg-final { scan-tree-dump-times "gimple_simplified to.* >= -2147483638" 1 "forwprop1" } } */
36 /* { dg-final { scan-tree-dump-times "gimple_simplified to.* >= -2147483628" 1 "forwprop1" } } */
37 /* { dg-final { scan-tree-dump-times "gimple_simplified to.* <= 2147483617" 1 "forwprop1" } } */
38 /* { dg-final { scan-tree-dump-times "gimple_simplified to.* <= 2147483607" 1 "forwprop1" } } */