1 /* PR rtl-optimization/46212 */
2 /* { dg-do compile } */
3 /* { dg-options "-O3 -funroll-loops" } */
4 /* { dg-options "-O3 -funroll-loops -march=i386" { target { { i686-*-* x86_64-*-* } && ia32 } } } */
5 /* { dg-require-effective-target int32plus } */
6
7 static inline unsigned
foo(void * x)8 foo (void *x)
9 {
10 unsigned y = *(volatile unsigned *) (x);
11 return (y >> 24) | ((y >> 8) & 0xff00) | ((y & 0xff00) << 8) | (y << 24);
12 }
13
14 void
bar(void * x,void * y,int z)15 bar (void *x, void *y, int z)
16 {
17 unsigned c;
18 while (z--)
19 {
20 c = foo (y);
21 *(unsigned *) x = (c & 0xf80000) >> 9 | (c & 0xf800) >> 6
22 | (c & 0xf8) >> 3 | (c & 0x80000000) >> 16;
23 }
24 }
25