1 /* Check rotate pattern detection. */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fno-ipa-icf -fdump-tree-optimized" } */
4 /* { dg-final { scan-tree-dump-times "r\[<>]\[<>]" 96 "optimized" } } */
7 f1 (unsigned int x
, unsigned int y
)
9 return (x
<< y
) | (x
>> (__CHAR_BIT__
* __SIZEOF_INT__
- y
));
13 f2 (unsigned int x
, unsigned long int y
)
15 return (x
<< y
) | (x
>> (__CHAR_BIT__
* __SIZEOF_INT__
- y
));
19 f3 (unsigned int x
, int y
__attribute__((unused
)))
21 return (x
<< 1) | (x
>> (__CHAR_BIT__
* __SIZEOF_INT__
- 1));
25 f4 (unsigned int x
, int y
__attribute__((unused
)))
27 return (x
<< (__CHAR_BIT__
* __SIZEOF_INT__
- 1)) | (x
>> 1);
31 f5 (unsigned short int x
, unsigned int y
)
33 return (x
<< y
) | (x
>> (__CHAR_BIT__
* __SIZEOF_SHORT__
- y
));
37 f6 (unsigned short int x
, unsigned long int y
)
39 return (x
<< y
) | (x
>> (__CHAR_BIT__
* __SIZEOF_SHORT__
- y
));
43 f7 (unsigned char x
, unsigned int y
)
45 return (x
<< y
) | (x
>> (__CHAR_BIT__
- y
));
49 f8 (unsigned char x
, unsigned long int y
)
51 return (x
<< y
) | (x
>> (__CHAR_BIT__
- y
));
55 f9 (unsigned int x
, unsigned int y
)
57 return (x
<< y
) | (x
>> (__CHAR_BIT__
* sizeof (unsigned int) - y
));
61 f10 (unsigned int x
, unsigned long int y
)
63 return (x
<< y
) | (x
>> (__CHAR_BIT__
* sizeof (unsigned int) - y
));
67 f11 (unsigned int x
, int y
__attribute__((unused
)))
69 return (x
<< 1) | (x
>> (__CHAR_BIT__
* sizeof (unsigned int) - 1));
73 f12 (unsigned int x
, int y
__attribute__((unused
)))
75 return (x
<< (__CHAR_BIT__
* sizeof (unsigned int) - 1)) | (x
>> 1);
79 f13 (unsigned short int x
, unsigned int y
)
81 return (x
<< y
) | (x
>> (__CHAR_BIT__
* sizeof (unsigned short) - y
));
85 f14 (unsigned short int x
, unsigned long int y
)
87 return (x
<< y
) | (x
>> (__CHAR_BIT__
* sizeof (unsigned short) - y
));
91 f15 (unsigned char x
, unsigned int y
)
93 return (x
<< y
) | (x
>> (__CHAR_BIT__
* sizeof (unsigned char) - y
));
97 f16 (unsigned char x
, unsigned long int y
)
99 return (x
<< y
) | (x
>> (__CHAR_BIT__
* sizeof (unsigned char) - y
));
103 f17 (unsigned int x
, unsigned int y
)
105 return (x
>> (__CHAR_BIT__
* __SIZEOF_INT__
- y
)) ^ (x
<< y
);
109 f18 (unsigned int x
, unsigned long int y
)
111 return (x
>> (__CHAR_BIT__
* __SIZEOF_INT__
- y
)) ^ (x
<< y
);
115 f19 (unsigned int x
, int y
__attribute__((unused
)))
117 return (x
>> (__CHAR_BIT__
* __SIZEOF_INT__
- 1)) ^ (x
<< 1);
121 f20 (unsigned int x
, int y
__attribute__((unused
)))
123 return (x
>> 1) ^ (x
<< (__CHAR_BIT__
* __SIZEOF_INT__
- 1));
127 f21 (unsigned short int x
, unsigned int y
)
129 return (x
>> (__CHAR_BIT__
* __SIZEOF_SHORT__
- y
)) ^ (x
<< y
);
133 f22 (unsigned short int x
, unsigned long int y
)
135 return (x
>> (__CHAR_BIT__
* __SIZEOF_SHORT__
- y
)) ^ (x
<< y
);
139 f23 (unsigned char x
, unsigned int y
)
141 return (x
>> (__CHAR_BIT__
- y
)) ^ (x
<< y
);
145 f24 (unsigned char x
, unsigned long int y
)
147 return (x
>> (__CHAR_BIT__
- y
)) ^ (x
<< y
);
151 f25 (unsigned int x
, unsigned int y
)
153 return (x
>> (__CHAR_BIT__
* sizeof (unsigned int) - y
)) ^ (x
<< y
);
157 f26 (unsigned int x
, unsigned long int y
)
159 return (x
>> (__CHAR_BIT__
* sizeof (unsigned int) - y
)) ^ (x
<< y
);
163 f27 (unsigned int x
, int y
__attribute__((unused
)))
165 return (x
>> (__CHAR_BIT__
* sizeof (unsigned int) - 1)) ^ (x
<< 1);
169 f28 (unsigned int x
, int y
__attribute__((unused
)))
171 return (x
>> 1) ^ (x
<< (__CHAR_BIT__
* sizeof (unsigned int) - 1));
175 f29 (unsigned short int x
, unsigned int y
)
177 return (x
>> (__CHAR_BIT__
* sizeof (unsigned short) - y
)) ^ (x
<< y
);
181 f30 (unsigned short int x
, unsigned long int y
)
183 return (x
>> (__CHAR_BIT__
* sizeof (unsigned short) - y
)) ^ (x
<< y
);
187 f31 (unsigned char x
, unsigned int y
)
189 return (x
>> (__CHAR_BIT__
* sizeof (unsigned char) - y
)) ^ (x
<< y
);
193 f32 (unsigned char x
, unsigned long int y
)
195 return (x
>> (__CHAR_BIT__
* sizeof (unsigned char) - y
)) ^ (x
<< y
);
199 f33 (unsigned int x
, unsigned int y
)
201 return (x
>> y
) | (x
<< (__CHAR_BIT__
* __SIZEOF_INT__
- y
));
205 f34 (unsigned int x
, unsigned long int y
)
207 return (x
>> y
) | (x
<< (__CHAR_BIT__
* __SIZEOF_INT__
- y
));
211 f35 (unsigned int x
, int y
__attribute__((unused
)))
213 return (x
>> 1) | (x
<< (__CHAR_BIT__
* __SIZEOF_INT__
- 1));
217 f36 (unsigned int x
, int y
__attribute__((unused
)))
219 return (x
>> (__CHAR_BIT__
* __SIZEOF_INT__
- 1)) | (x
<< 1);
223 f37 (unsigned short int x
, unsigned int y
)
225 return (x
>> y
) | (x
<< (__CHAR_BIT__
* __SIZEOF_SHORT__
- y
));
229 f38 (unsigned short int x
, unsigned long int y
)
231 return (x
>> y
) | (x
<< (__CHAR_BIT__
* __SIZEOF_SHORT__
- y
));
235 f39 (unsigned char x
, unsigned int y
)
237 return (x
>> y
) | (x
<< (__CHAR_BIT__
- y
));
241 f40 (unsigned char x
, unsigned long int y
)
243 return (x
>> y
) | (x
<< (__CHAR_BIT__
- y
));
247 f41 (unsigned int x
, unsigned int y
)
249 return (x
>> y
) | (x
<< (__CHAR_BIT__
* sizeof (unsigned int) - y
));
253 f42 (unsigned int x
, unsigned long int y
)
255 return (x
>> y
) | (x
<< (__CHAR_BIT__
* sizeof (unsigned int) - y
));
259 f43 (unsigned int x
, int y
__attribute__((unused
)))
261 return (x
>> 1) | (x
<< (__CHAR_BIT__
* sizeof (unsigned int) - 1));
265 f44 (unsigned int x
, int y
__attribute__((unused
)))
267 return (x
>> (__CHAR_BIT__
* sizeof (unsigned int) - 1)) | (x
<< 1);
271 f45 (unsigned short int x
, unsigned int y
)
273 return (x
>> y
) | (x
<< (__CHAR_BIT__
* sizeof (unsigned short) - y
));
277 f46 (unsigned short int x
, unsigned long int y
)
279 return (x
>> y
) | (x
<< (__CHAR_BIT__
* sizeof (unsigned short) - y
));
283 f47 (unsigned char x
, unsigned int y
)
285 return (x
>> y
) | (x
<< (__CHAR_BIT__
* sizeof (unsigned char) - y
));
289 f48 (unsigned char x
, unsigned long int y
)
291 return (x
>> y
) | (x
<< (__CHAR_BIT__
* sizeof (unsigned char) - y
));
295 f49 (unsigned int x
, unsigned int y
)
297 return (x
<< (__CHAR_BIT__
* __SIZEOF_INT__
- y
)) ^ (x
>> y
);
301 f50 (unsigned int x
, unsigned long int y
)
303 return (x
<< (__CHAR_BIT__
* __SIZEOF_INT__
- y
)) ^ (x
>> y
);
307 f51 (unsigned int x
, int y
__attribute__((unused
)))
309 return (x
<< (__CHAR_BIT__
* __SIZEOF_INT__
- 1)) ^ (x
>> 1);
313 f52 (unsigned int x
, int y
__attribute__((unused
)))
315 return (x
<< 1) ^ (x
>> (__CHAR_BIT__
* __SIZEOF_INT__
- 1));
319 f53 (unsigned short int x
, unsigned int y
)
321 return (x
<< (__CHAR_BIT__
* __SIZEOF_SHORT__
- y
)) ^ (x
>> y
);
325 f54 (unsigned short int x
, unsigned long int y
)
327 return (x
<< (__CHAR_BIT__
* __SIZEOF_SHORT__
- y
)) ^ (x
>> y
);
331 f55 (unsigned char x
, unsigned int y
)
333 return (x
<< (__CHAR_BIT__
- y
)) ^ (x
>> y
);
337 f56 (unsigned char x
, unsigned long int y
)
339 return (x
<< (__CHAR_BIT__
- y
)) ^ (x
>> y
);
343 f57 (unsigned int x
, unsigned int y
)
345 return (x
<< (__CHAR_BIT__
* sizeof (unsigned int) - y
)) ^ (x
>> y
);
349 f58 (unsigned int x
, unsigned long int y
)
351 return (x
<< (__CHAR_BIT__
* sizeof (unsigned int) - y
)) ^ (x
>> y
);
355 f59 (unsigned int x
, int y
__attribute__((unused
)))
357 return (x
<< (__CHAR_BIT__
* sizeof (unsigned int) - 1)) ^ (x
>> 1);
361 f60 (unsigned int x
, int y
__attribute__((unused
)))
363 return (x
<< 1) ^ (x
>> (__CHAR_BIT__
* sizeof (unsigned int) - 1));
367 f61 (unsigned short int x
, unsigned int y
)
369 return (x
<< (__CHAR_BIT__
* sizeof (unsigned short) - y
)) ^ (x
>> y
);
373 f62 (unsigned short int x
, unsigned long int y
)
375 return (x
<< (__CHAR_BIT__
* sizeof (unsigned short) - y
)) ^ (x
>> y
);
379 f63 (unsigned char x
, unsigned int y
)
381 return (x
<< (__CHAR_BIT__
* sizeof (unsigned char) - y
)) ^ (x
>> y
);
385 f64 (unsigned char x
, unsigned long int y
)
387 return (x
<< (__CHAR_BIT__
* sizeof (unsigned char) - y
)) ^ (x
>> y
);
391 f65 (unsigned int x
, unsigned int y
)
393 return (x
<< y
) + (x
>> (__CHAR_BIT__
* __SIZEOF_INT__
- y
));
397 f66 (unsigned int x
, unsigned long int y
)
399 return (x
<< y
) + (x
>> (__CHAR_BIT__
* __SIZEOF_INT__
- y
));
403 f67 (unsigned int x
, int y
__attribute__((unused
)))
405 return (x
<< 1) + (x
>> (__CHAR_BIT__
* __SIZEOF_INT__
- 1));
409 f68 (unsigned int x
, int y
__attribute__((unused
)))
411 return (x
<< (__CHAR_BIT__
* __SIZEOF_INT__
- 1)) + (x
>> 1);
415 f69 (unsigned short int x
, unsigned int y
)
417 return (x
<< y
) + (x
>> (__CHAR_BIT__
* __SIZEOF_SHORT__
- y
));
421 f70 (unsigned short int x
, unsigned long int y
)
423 return (x
<< y
) + (x
>> (__CHAR_BIT__
* __SIZEOF_SHORT__
- y
));
427 f71 (unsigned char x
, unsigned int y
)
429 return (x
<< y
) + (x
>> (__CHAR_BIT__
- y
));
433 f72 (unsigned char x
, unsigned long int y
)
435 return (x
<< y
) + (x
>> (__CHAR_BIT__
- y
));
439 f73 (unsigned int x
, unsigned int y
)
441 return (x
<< y
) + (x
>> (__CHAR_BIT__
* sizeof (unsigned int) - y
));
445 f74 (unsigned int x
, unsigned long int y
)
447 return (x
<< y
) + (x
>> (__CHAR_BIT__
* sizeof (unsigned int) - y
));
451 f75 (unsigned int x
, int y
__attribute__((unused
)))
453 return (x
<< 1) + (x
>> (__CHAR_BIT__
* sizeof (unsigned int) - 1));
457 f76 (unsigned int x
, int y
__attribute__((unused
)))
459 return (x
<< (__CHAR_BIT__
* sizeof (unsigned int) - 1)) + (x
>> 1);
463 f77 (unsigned short int x
, unsigned int y
)
465 return (x
<< y
) + (x
>> (__CHAR_BIT__
* sizeof (unsigned short) - y
));
469 f78 (unsigned short int x
, unsigned long int y
)
471 return (x
<< y
) + (x
>> (__CHAR_BIT__
* sizeof (unsigned short) - y
));
475 f79 (unsigned char x
, unsigned int y
)
477 return (x
<< y
) + (x
>> (__CHAR_BIT__
* sizeof (unsigned char) - y
));
481 f80 (unsigned char x
, unsigned long int y
)
483 return (x
<< y
) + (x
>> (__CHAR_BIT__
* sizeof (unsigned char) - y
));
487 f81 (unsigned int x
, unsigned int y
)
489 return (x
<< (__CHAR_BIT__
* __SIZEOF_INT__
- y
)) + (x
>> y
);
493 f82 (unsigned int x
, unsigned long int y
)
495 return (x
<< (__CHAR_BIT__
* __SIZEOF_INT__
- y
)) + (x
>> y
);
499 f83 (unsigned int x
, int y
__attribute__((unused
)))
501 return (x
<< (__CHAR_BIT__
* __SIZEOF_INT__
- 1)) + (x
>> 1);
505 f84 (unsigned int x
, int y
__attribute__((unused
)))
507 return (x
<< 1) + (x
>> (__CHAR_BIT__
* __SIZEOF_INT__
- 1));
511 f85 (unsigned short int x
, unsigned int y
)
513 return (x
<< (__CHAR_BIT__
* __SIZEOF_SHORT__
- y
)) + (x
>> y
);
517 f86 (unsigned short int x
, unsigned long int y
)
519 return (x
<< (__CHAR_BIT__
* __SIZEOF_SHORT__
- y
)) + (x
>> y
);
523 f87 (unsigned char x
, unsigned int y
)
525 return (x
<< (__CHAR_BIT__
- y
)) + (x
>> y
);
529 f88 (unsigned char x
, unsigned long int y
)
531 return (x
<< (__CHAR_BIT__
- y
)) + (x
>> y
);
535 f89 (unsigned int x
, unsigned int y
)
537 return (x
<< (__CHAR_BIT__
* sizeof (unsigned int) - y
)) + (x
>> y
);
541 f90 (unsigned int x
, unsigned long int y
)
543 return (x
<< (__CHAR_BIT__
* sizeof (unsigned int) - y
)) + (x
>> y
);
547 f91 (unsigned int x
, int y
__attribute__((unused
)))
549 return (x
<< (__CHAR_BIT__
* sizeof (unsigned int) - 1)) + (x
>> 1);
553 f92 (unsigned int x
, int y
__attribute__((unused
)))
555 return (x
<< 1) + (x
>> (__CHAR_BIT__
* sizeof (unsigned int) - 1));
559 f93 (unsigned short int x
, unsigned int y
)
561 return (x
<< (__CHAR_BIT__
* sizeof (unsigned short) - y
)) + (x
>> y
);
565 f94 (unsigned short int x
, unsigned long int y
)
567 return (x
<< (__CHAR_BIT__
* sizeof (unsigned short) - y
)) + (x
>> y
);
571 f95 (unsigned char x
, unsigned int y
)
573 return (x
<< (__CHAR_BIT__
* sizeof (unsigned char) - y
)) + (x
>> y
);
577 f96 (unsigned char x
, unsigned long int y
)
579 return (x
<< (__CHAR_BIT__
* sizeof (unsigned char) - y
)) + (x
>> y
);