1 /* PR tree-optimization/108440 */
2 /* { dg-do compile { target { { ilp32 || lp64 } || llp64 } } } */
3 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 /* { dg-final { scan-tree-dump-times " r<< " 5 "optimized" } } */
5 /* { dg-final { scan-tree-dump-times " \\\& 7;" 4 "optimized" } } */
8 foo (unsigned char x
, unsigned int y
)
11 __builtin_unreachable ();
12 return (x
<< y
) | (x
>> ((-y
) & (__CHAR_BIT__
- 1)));
16 bar (unsigned char x
, unsigned int y
)
18 if (y
>= __CHAR_BIT__
)
19 __builtin_unreachable ();
20 return (x
<< y
) | (x
>> ((-y
) & (__CHAR_BIT__
- 1)));
24 baz (unsigned char x
, unsigned int y
)
26 if (y
> __CHAR_BIT__
&& y
!= 2 * __CHAR_BIT__
)
27 __builtin_unreachable ();
28 return (x
<< y
) | (x
>> ((-y
) & (__CHAR_BIT__
- 1)));
32 qux (unsigned char x
, unsigned int y
)
34 if (y
> __CHAR_BIT__
&& y
!= 2 * __CHAR_BIT__
&& y
!= __CHAR_BIT__
+ 2)
35 __builtin_unreachable ();
36 return (x
<< y
) | (x
>> ((-y
) & (__CHAR_BIT__
- 1)));
40 quux (unsigned char x
, unsigned int y
)
43 __builtin_unreachable ();
44 return (x
<< y
) | (x
>> (__CHAR_BIT__
- y
));
48 corge (unsigned char x
, unsigned int y
)
50 if (y
>= __CHAR_BIT__
)
51 __builtin_unreachable ();
52 return (x
<< y
) | (x
>> (__CHAR_BIT__
- y
));