| 1 |
/* PR rtl-optimization/83363 */ |
| 2 |
/* { dg-do run } */ |
| 3 |
/* { dg-options "-O2 -fno-forward-propagate" } */ |
| 4 |
|
| 5 |
unsigned char a; |
| 6 |
unsigned int b; |
| 7 |
|
| 8 |
static unsigned short __attribute__ ((noinline, noclone)) |
| 9 |
foo (unsigned short x) |
| 10 |
{ |
| 11 |
x -= b; |
| 12 |
x <<= x == 0; |
| 13 |
a = ~0; |
| 14 |
a >>= (unsigned char) x == 0; |
| 15 |
x *= a -= ~a; |
| 16 |
return x; |
| 17 |
} |
| 18 |
|
| 19 |
int |
| 20 |
main () |
| 21 |
{ |
| 22 |
asm volatile ("" : : : "memory"); |
| 23 |
if (foo (3) != (unsigned short) (3 * (unsigned char) ~0)) |
| 24 |
__builtin_abort (); |
| 25 |
return 0; |
| 26 |
} |