blob: eb3b1ea8dd6f3e4af55b2097af4280da1314e869 (
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
|
/* PR tree-optimization/96685 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
/* { dg-final { scan-tree-dump-times "return 1;" 6 "optimized" } } */
unsigned
f1 (unsigned x, unsigned y)
{
unsigned a = ~(x - y);
unsigned b = ~x + y;
return a == b;
}
unsigned
f2 (unsigned x)
{
unsigned a = ~(x + -124U);
unsigned b = ~x + 124U;
return a == b;
}
unsigned
f3 (unsigned x)
{
unsigned a = ~(x + 124U);
unsigned b = ~x + -124U;
return a == b;
}
int
f4 (int x, int y)
{
int a = ~(x - y);
int b = ~x + y;
return a == b;
}
int
f5 (int x)
{
int a = ~(x + -124);
int b = ~x + 124;
return a == b;
}
int
f6 (int x)
{
int a = ~(x + 124);
int b = ~x + -124;
return a == b;
}
|