blob: c04447fb3cf537b764bd01e4dcd49a5645e5b9f6 (
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
66
67
68
69
70
71
72
73
74
|
/* PR middle-end/29749 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-original" } */
#if __SCHAR_MAX__ == 127
unsigned char
e1 (unsigned char a)
{
return a >> 5 | a << 3;
}
unsigned char
e2 (unsigned char a)
{
return (a & 0xe0) >> 5 | (a & 0x1f) << 3;
}
unsigned char
e3 (unsigned char a)
{
return ((a >> 5) & 0x07) | ((a << 3) & 0xf8);
}
#endif
#if __SHRT_MAX__ == 32767
unsigned short
f1 (unsigned short a)
{
return a >> 8 | a << 8;
}
unsigned short
f2 (unsigned short a)
{
return (a & 0xff00) >> 8 | (a & 0x00ff) << 8;
}
unsigned short
f3 (unsigned short a)
{
return ((a >> 8) & 0x00ff) | ((a << 8) & 0xff00);
}
#endif
#if __INT_MAX__ == 2147483647
unsigned int
g1 (unsigned int a)
{
return a >> 24 | a << 8;
}
unsigned int
g2 (unsigned int a)
{
return (a & 0xff000000) >> 24 | (a & 0x00ffffff) << 8;
}
unsigned int
g3 (unsigned int a)
{
return ((a >> 24) & 0x000000ff) | ((a << 8) & 0xffffff00U);
}
#endif
int i;
/* { dg-final { scan-tree-dump-times "&" 0 "original" } } */
/* { dg-final { cleanup-tree-dump "original" } } */
|