1 /* PR middle-end/62263 */
2 /* PR middle-end/82498 */
3 /* { dg-do compile } */
4 /* { dg-options "-O2 -fno-ipa-icf -fdump-tree-optimized" } */
5 /* { dg-final { scan-tree-dump-times "r\[<>]\[<>]" 23 "optimized" } } */
6 /* { dg-final { scan-tree-dump-not "PHI <" "optimized" } } */
9 f1 (unsigned int x
, unsigned char y
)
11 y
%= __CHAR_BIT__
* __SIZEOF_INT__
;
12 return (x
<< y
) | (x
>> (__CHAR_BIT__
* __SIZEOF_INT__
- y
));
16 f2 (unsigned int x
, signed char y
)
18 y
&= __CHAR_BIT__
* __SIZEOF_INT__
- 1;
19 return (x
<< y
) | (x
>> (__CHAR_BIT__
* __SIZEOF_INT__
- y
));
23 f3 (unsigned int x
, unsigned char y
)
25 return (x
<< (y
& (__CHAR_BIT__
* __SIZEOF_INT__
- 1))) | (x
>> (__CHAR_BIT__
* __SIZEOF_INT__
- (y
& (__CHAR_BIT__
* __SIZEOF_INT__
- 1))));
29 f4 (unsigned int x
, unsigned char y
)
31 y
= y
& (__CHAR_BIT__
* __SIZEOF_INT__
- 1);
32 return y
? (x
<< y
) | (x
>> (__CHAR_BIT__
* __SIZEOF_INT__
- y
)) : x
;
36 f5 (unsigned int x
, unsigned char y
)
38 y
= y
& (__CHAR_BIT__
* __SIZEOF_INT__
- 1);
39 return (x
<< y
) | (x
>> ((__CHAR_BIT__
* __SIZEOF_INT__
- y
) & (__CHAR_BIT__
* __SIZEOF_INT__
- 1)));
43 f6 (unsigned int x
, unsigned char y
)
45 return (x
<< (y
& (__CHAR_BIT__
* __SIZEOF_INT__
- 1))) | (x
>> ((__CHAR_BIT__
* __SIZEOF_INT__
- (y
& (__CHAR_BIT__
* __SIZEOF_INT__
- 1))) & (__CHAR_BIT__
* __SIZEOF_INT__
- 1)));
49 f7 (unsigned int x
, unsigned char y
)
51 return (x
<< (y
& (__CHAR_BIT__
* __SIZEOF_INT__
- 1))) | (x
>> ((__CHAR_BIT__
* __SIZEOF_INT__
- y
) & (__CHAR_BIT__
* __SIZEOF_INT__
- 1)));
55 f8 (unsigned int x
, unsigned char y
)
57 return (x
<< (y
& (__CHAR_BIT__
* __SIZEOF_INT__
- 1))) | (x
>> ((-y
) & (__CHAR_BIT__
* __SIZEOF_INT__
- 1)));
61 f9 (unsigned int x
, int y
)
63 return (0x12345678U
<< (y
& (__CHAR_BIT__
* __SIZEOF_INT__
- 1))) | (0x12345678U
>> (-y
& (__CHAR_BIT__
* __SIZEOF_INT__
- 1)));
67 f10 (unsigned int x
, int y
)
69 return (0x12345678U
>> (-y
& (__CHAR_BIT__
* __SIZEOF_INT__
- 1))) | (0x12345678U
<< (y
& (__CHAR_BIT__
* __SIZEOF_INT__
- 1)));
73 f11 (unsigned int x
, int y
)
75 return (0x12345678U
>> (y
& (__CHAR_BIT__
* __SIZEOF_INT__
- 1))) | (0x12345678U
<< (-y
& (__CHAR_BIT__
* __SIZEOF_INT__
- 1)));
79 f12 (unsigned int x
, int y
)
81 return (0x12345678U
<< (-y
& (__CHAR_BIT__
* __SIZEOF_INT__
- 1))) | (0x12345678U
>> (y
& (__CHAR_BIT__
* __SIZEOF_INT__
- 1)));
85 f13 (unsigned x
, unsigned char y
)
89 y
%= __CHAR_BIT__
* __SIZEOF_INT__
;
90 return (x
<< y
) | (x
>> (__CHAR_BIT__
* __SIZEOF_INT__
- y
));
94 f14 (unsigned x
, unsigned y
)
98 y
%= __CHAR_BIT__
* __SIZEOF_INT__
;
99 return (x
<< y
) | (x
>> (__CHAR_BIT__
* __SIZEOF_INT__
- y
));
103 f15 (unsigned x
, unsigned short y
)
107 y
%= __CHAR_BIT__
* __SIZEOF_INT__
;
108 return (x
<< y
) | (x
>> (__CHAR_BIT__
* __SIZEOF_INT__
- y
));
112 f16 (unsigned x
, unsigned char y
)
114 y
%= __CHAR_BIT__
* __SIZEOF_INT__
;
117 return (x
<< y
) | (x
>> (__CHAR_BIT__
* __SIZEOF_INT__
- y
));
121 f17 (unsigned x
, unsigned y
)
123 y
%= __CHAR_BIT__
* __SIZEOF_INT__
;
126 return (x
<< y
) | (x
>> (__CHAR_BIT__
* __SIZEOF_INT__
- y
));
130 f18 (unsigned x
, unsigned short y
)
132 y
%= __CHAR_BIT__
* __SIZEOF_INT__
;
135 return (x
<< y
) | (x
>> (__CHAR_BIT__
* __SIZEOF_INT__
- y
));
139 f19 (unsigned x
, unsigned char y
)
141 y
%= __CHAR_BIT__
* __SIZEOF_INT__
;
142 return (x
<< y
) | (x
>> (((unsigned char) -y
) % (__CHAR_BIT__
* __SIZEOF_INT__
)));
146 f20 (unsigned x
, unsigned int y
)
148 y
%= __CHAR_BIT__
* __SIZEOF_INT__
;
149 return (x
<< y
) | (x
>> (-y
% (__CHAR_BIT__
* __SIZEOF_INT__
)));
153 f21 (unsigned x
, unsigned short y
)
155 y
%= __CHAR_BIT__
* __SIZEOF_INT__
;
156 return (x
<< y
) | (x
>> (((unsigned short) -y
) % (__CHAR_BIT__
* __SIZEOF_INT__
)));
160 f22 (unsigned x
, unsigned char y
)
162 y
%= __CHAR_BIT__
* __SIZEOF_INT__
;
163 return (x
<< y
) | (x
>> (-y
& ((__CHAR_BIT__
* __SIZEOF_INT__
) - 1)));
167 f23 (unsigned x
, unsigned short y
)
169 y
%= __CHAR_BIT__
* __SIZEOF_INT__
;
170 return (x
<< y
) | (x
>> (-y
& ((__CHAR_BIT__
* __SIZEOF_INT__
) - 1)));