| 1 |
/* PR target/115863 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O3 -fdump-rtl-expand-details" } */ |
| 4 |
|
| 5 |
#include <stdint-gcc.h> |
| 6 |
|
| 7 |
typedef struct z_stream_s { |
| 8 |
uint32_t avail_out; |
| 9 |
} z_stream; |
| 10 |
|
| 11 |
typedef z_stream *z_streamp; |
| 12 |
|
| 13 |
extern int deflate (z_streamp strmp); |
| 14 |
|
| 15 |
int compress2 (uint64_t *destLen) |
| 16 |
{ |
| 17 |
z_stream stream; |
| 18 |
int err; |
| 19 |
const uint32_t max = (uint32_t)(-1); |
| 20 |
uint64_t left; |
| 21 |
|
| 22 |
left = *destLen; |
| 23 |
|
| 24 |
stream.avail_out = 0; |
| 25 |
|
| 26 |
do { |
| 27 |
if (stream.avail_out == 0) { |
| 28 |
stream.avail_out = left > (uint64_t)max ? max : (uint32_t)left; |
| 29 |
left -= stream.avail_out; |
| 30 |
} |
| 31 |
err = deflate(&stream); |
| 32 |
} while (err == 0); |
| 33 |
|
| 34 |
return err; |
| 35 |
} |
| 36 |
|
| 37 |
/* { dg-final { scan-rtl-dump-not ".SAT_TRUNC " "expand" } } */ |