| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-tree-evrp-details" } */ |
| 3 |
|
| 4 |
static int blocksize = 4096; |
| 5 |
|
| 6 |
int bar (int); |
| 7 |
|
| 8 |
void foo (void) |
| 9 |
{ |
| 10 |
int toread; |
| 11 |
int bytes; |
| 12 |
__attribute__ ((used)) |
| 13 |
static char eof_reached = 0; |
| 14 |
|
| 15 |
toread = blocksize; |
| 16 |
bytes = 1; |
| 17 |
|
| 18 |
while (toread != 0) |
| 19 |
{ |
| 20 |
bytes = bar (toread); |
| 21 |
if (bytes <= 0) |
| 22 |
{ |
| 23 |
if (bytes < 0) |
| 24 |
continue; |
| 25 |
break; |
| 26 |
} |
| 27 |
toread -= bytes; |
| 28 |
} |
| 29 |
|
| 30 |
if (bytes == 0) |
| 31 |
eof_reached = 1; |
| 32 |
} |
| 33 |
|
| 34 |
|
| 35 |
/* First, we should simplify the bits < 0 test within the loop. */ |
| 36 |
/* { dg-final { scan-tree-dump-times "Simplified relational" 1 "evrp" } } */ |