PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / pr46212.c
bloba549a99050f1f2ba5e8b93c5820b0fa9d44fcee1
1 /* PR rtl-optimization/46212 */
2 /* { dg-do compile } */
3 /* { dg-options "-O3 -funroll-loops" } */
4 /* { dg-options "-O3 -funroll-loops -march=i386" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
5 /* { dg-require-effective-target int32plus } */
7 static inline unsigned
8 foo (void *x)
10 unsigned y = *(volatile unsigned *) (x);
11 return (y >> 24) | ((y >> 8) & 0xff00) | ((y & 0xff00) << 8) | (y << 24);
14 void
15 bar (void *x, void *y, int z)
17 unsigned c;
18 while (z--)
20 c = foo (y);
21 *(unsigned *) x = (c & 0xf80000) >> 9 | (c & 0xf800) >> 6
22 | (c & 0xf8) >> 3 | (c & 0x80000000) >> 16;