| 1 |
|
| 2 |
/* PR target/58578 */ |
| 3 |
/* { dg-do run } */ |
| 4 |
/* { dg-options "-O1" } */ |
| 5 |
|
| 6 |
#include <stdlib.h> |
| 7 |
|
| 8 |
typedef struct { |
| 9 |
long _prec; |
| 10 |
int _flag; |
| 11 |
long _exp; |
| 12 |
} __my_st_t; |
| 13 |
|
| 14 |
typedef __my_st_t *__my_st_ptr; |
| 15 |
|
| 16 |
int |
| 17 |
_test_fn (__my_st_ptr y, const __my_st_ptr xt) |
| 18 |
{ |
| 19 |
int inexact; |
| 20 |
if (xt->_exp != -2147483647L) |
| 21 |
{ |
| 22 |
(y->_flag = xt->_flag); |
| 23 |
} |
| 24 |
|
| 25 |
do { |
| 26 |
__my_st_ptr _y = y; |
| 27 |
long _err1 = -2 * xt->_exp; |
| 28 |
long _err2 = 2; |
| 29 |
if (0 < _err1) |
| 30 |
{ |
| 31 |
unsigned long _err = (unsigned long) _err1 + _err2; |
| 32 |
if (__builtin_expect(!!(_err > _y->_prec + 1), 0)) |
| 33 |
return 2; |
| 34 |
return 3; |
| 35 |
} |
| 36 |
} while (0); |
| 37 |
|
| 38 |
return 0; |
| 39 |
} |
| 40 |
|
| 41 |
int main () |
| 42 |
{ |
| 43 |
__my_st_t x, y; |
| 44 |
long pz; |
| 45 |
int inex; |
| 46 |
|
| 47 |
x._prec = 914; |
| 48 |
y._exp = 18; |
| 49 |
if (_test_fn (&x, &y)) |
| 50 |
{ |
| 51 |
abort(); |
| 52 |
} |
| 53 |
return 0; |
| 54 |
} |