1 /* PR middle-end/29749 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-original" } */
4
5 #if __SCHAR_MAX__ == 127
6
7 unsigned char
e1(unsigned char a)8 e1 (unsigned char a)
9 {
10 return a >> 5 | a << 3;
11 }
12
13 unsigned char
e2(unsigned char a)14 e2 (unsigned char a)
15 {
16 return (a & 0xe0) >> 5 | (a & 0x1f) << 3;
17 }
18
19 unsigned char
e3(unsigned char a)20 e3 (unsigned char a)
21 {
22 return ((a >> 5) & 0x07) | ((a << 3) & 0xf8);
23 }
24
25 #endif
26
27 #if __SHRT_MAX__ == 32767
28
29 unsigned short
f1(unsigned short a)30 f1 (unsigned short a)
31 {
32 return a >> 8 | a << 8;
33 }
34
35 unsigned short
f2(unsigned short a)36 f2 (unsigned short a)
37 {
38 return (a & 0xff00) >> 8 | (a & 0x00ff) << 8;
39 }
40
41 unsigned short
f3(unsigned short a)42 f3 (unsigned short a)
43 {
44 return ((a >> 8) & 0x00ff) | ((a << 8) & 0xff00);
45 }
46
47 #endif
48
49 #if __INT_MAX__ == 2147483647
50
51 unsigned int
g1(unsigned int a)52 g1 (unsigned int a)
53 {
54 return a >> 24 | a << 8;
55 }
56
57 unsigned int
g2(unsigned int a)58 g2 (unsigned int a)
59 {
60 return (a & 0xff000000) >> 24 | (a & 0x00ffffff) << 8;
61 }
62
63 unsigned int
g3(unsigned int a)64 g3 (unsigned int a)
65 {
66 return ((a >> 24) & 0x000000ff) | ((a << 8) & 0xffffff00U);
67 }
68
69 #endif
70
71 int i;
72
73 /* { dg-final { scan-tree-dump-times "&" 0 "original" } } */
74