| 1 |
/* { dg-do compile { target { ! ia32 } } } */ |
| 2 |
/* { dg-require-effective-target maybe_x32 } */ |
| 3 |
/* { dg-options "-mx32 -O2 -fPIC -mtls-dialect=gnu2" } */ |
| 4 |
/* { dg-final { scan-assembler-not "cmpl\[ \t\]+%fs:previous_emax@dtpoff\\(%eax\\)" } } */ |
| 5 |
|
| 6 |
typedef long mpfr_prec_t; |
| 7 |
typedef long mpfr_exp_t; |
| 8 |
typedef struct { |
| 9 |
mpfr_prec_t _mpfr_prec; |
| 10 |
} __mpfr_struct; |
| 11 |
typedef __mpfr_struct mpfr_t[1]; |
| 12 |
extern _Thread_local mpfr_exp_t __gmpfr_emax; |
| 13 |
static _Thread_local mpfr_exp_t previous_emax; |
| 14 |
static _Thread_local mpfr_t bound_emax; |
| 15 |
extern const mpfr_t __gmpfr_const_log2_RNDD; |
| 16 |
extern const mpfr_t __gmpfr_const_log2_RNDU; |
| 17 |
|
| 18 |
typedef enum { |
| 19 |
MPFR_RNDN=0, |
| 20 |
MPFR_RNDZ, |
| 21 |
MPFR_RNDU, |
| 22 |
MPFR_RNDD, |
| 23 |
MPFR_RNDA, |
| 24 |
MPFR_RNDF, |
| 25 |
MPFR_RNDNA=-1 |
| 26 |
} mpfr_rnd_t; |
| 27 |
typedef __mpfr_struct *mpfr_ptr; |
| 28 |
typedef const __mpfr_struct *mpfr_srcptr; |
| 29 |
void mpfr_mul (mpfr_ptr, mpfr_srcptr, mpfr_rnd_t); |
| 30 |
|
| 31 |
void |
| 32 |
foo (void) |
| 33 |
{ |
| 34 |
mpfr_exp_t saved_emax; |
| 35 |
|
| 36 |
if (__gmpfr_emax != previous_emax) |
| 37 |
{ |
| 38 |
saved_emax = __gmpfr_emax; |
| 39 |
|
| 40 |
bound_emax->_mpfr_prec = 32; |
| 41 |
|
| 42 |
mpfr_mul (bound_emax, saved_emax < 0 ? |
| 43 |
__gmpfr_const_log2_RNDD : __gmpfr_const_log2_RNDU, |
| 44 |
MPFR_RNDU); |
| 45 |
previous_emax = saved_emax; |
| 46 |
__gmpfr_emax = saved_emax; |
| 47 |
} |
| 48 |
} |