| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-O -fdump-tree-ifcombine-details" } */ |
| 3 |
|
| 4 |
/* Check that we don't get confused by multiple conversions. Conceivably, we |
| 5 |
could combine both tests using b, but the current logic won't do that. */ |
| 6 |
|
| 7 |
__attribute__((noipa)) |
| 8 |
int f(int *a,int *d) |
| 9 |
{ |
| 10 |
signed char b = *a; |
| 11 |
int c = b; |
| 12 |
*d = c; // This store is important even if otherwise unused |
| 13 |
if (c < 0 && (b&1)) |
| 14 |
return 1; |
| 15 |
return 0; |
| 16 |
} |
| 17 |
|
| 18 |
int main() |
| 19 |
{ |
| 20 |
unsigned char t = 0x81; |
| 21 |
int x = t, y; |
| 22 |
int tt = f(&x, &y); |
| 23 |
if (!tt) |
| 24 |
__builtin_abort(); |
| 25 |
} |
| 26 |
|
| 27 |
/* { dg-final { scan-tree-dump-not "optimizing" "ifcombine" } } */ |