blob: 24e1abef7742b1c263049e3f580e4e79c2e9aff5 (
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
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
|
/* PR tree-optimization/116024 */
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-forwprop1-details -fwrapv" } */
#include <stdint.h>
uint32_t f(void);
int32_t i2(void)
{
int32_t l = 10 - (int32_t)f();
return l <= 20; // f() - 11 >= -21
}
int32_t i2a(void)
{
int32_t l = 10 - (int32_t)f();
return l < 30; // f() - 11 > -31
}
int32_t i2b(void)
{
int32_t l = 200 - (int32_t)f();
return l <= 100; // f() - 201 >= -101
}
int32_t i2c(void)
{
int32_t l = 300 - (int32_t)f();
return l < 100; // f() - 301 > -101
}
int32_t i2d(void)
{
int32_t l = 1000 - (int32_t)f();
return l >= 2000; // f() - 1001 <= -2001
}
int32_t i2e(void)
{
int32_t l = 1000 - (int32_t)f();
return l > 3000; // f() - 1001 < -3001
}
int32_t i2f(void)
{
int32_t l = 20000 - (int32_t)f();
return l >= 10000; // f() - 20001 <= -10001
}
int32_t i2g(void)
{
int32_t l = 30000 - (int32_t)f();
return l > 10000; // f() - 30001 < -10001
}
/* { dg-final { scan-tree-dump-times "Removing dead stmt:.*?- _" 8 "forwprop1" } } */
/* { dg-final { scan-tree-dump-times "gimple_simplified to.* \\+ -11.*\n.*>= -21" 1 "forwprop1" } } */
/* { dg-final { scan-tree-dump-times "gimple_simplified to.* \\+ -11.*\n.*>= -30" 1 "forwprop1" } } */
/* { dg-final { scan-tree-dump-times "gimple_simplified to.* \\+ -201.*\n.*>= -101" 1 "forwprop1" } } */
/* { dg-final { scan-tree-dump-times "gimple_simplified to.* \\+ -301.*\n.*>= -100" 1 "forwprop1" } } */
/* { dg-final { scan-tree-dump-times "gimple_simplified to.* \\+ -1001.*\n.*< -2000" 1 "forwprop1" } } */
/* { dg-final { scan-tree-dump-times "gimple_simplified to.* \\+ -1001.*\n.*< -3001" 1 "forwprop1" } } */
/* { dg-final { scan-tree-dump-times "gimple_simplified to.* \\+ -20001.*\n.*< -10000" 1 "forwprop1" } } */
/* { dg-final { scan-tree-dump-times "gimple_simplified to.* \\+ -30001.*\n.*< -10001" 1 "forwprop1" } } */
|