diff options
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 13 | ||||
-rw-r--r-- | libgfortran/io/read.c | 2 | ||||
-rw-r--r-- | libgfortran/io/transfer128.c | 24 | ||||
-rw-r--r-- | libgfortran/io/write_float.def | 2 |
4 files changed, 22 insertions, 19 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 4c2d185..1eeeda3 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,16 @@ +2011-01-16 Jakub Jelinek <jakub@redhat.com> + + PR fortran/46625 + * io/write_float.def (DTOAQ): Use quadmath_flt128tostr + instead of quadmath_dtoa. + * io/transfer128.c (tmp1, tmp2): New variables, bring in + strtoflt128 and quadmath_flt128tostr. + (transfer_real128, transfer_real128_write, transfer_complex128, + transfer_complex128_write): Remove tmp1/tmp2 variables. + * io/read.c (convert_real): Use strtoflt128 instead of + quadmath_strtopQ, adjust for the changed arguments and return + value. + 2011-01-14 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/47296 diff --git a/libgfortran/io/read.c b/libgfortran/io/read.c index 33486fa2..50b1b40 100644 --- a/libgfortran/io/read.c +++ b/libgfortran/io/read.c @@ -165,7 +165,7 @@ convert_real (st_parameter_dt *dtp, void *dest, const char *buffer, int length) #if defined(HAVE_GFC_REAL_16) # if defined(GFC_REAL_16_IS_FLOAT128) case 16: - __qmath_(quadmath_strtopQ) (buffer, NULL, dest); + *((GFC_REAL_16*) dest) = __qmath_(strtoflt128) (buffer, NULL); break; # elif defined(HAVE_STRTOLD) case 16: diff --git a/libgfortran/io/transfer128.c b/libgfortran/io/transfer128.c index 66deabe..5690245 100644 --- a/libgfortran/io/transfer128.c +++ b/libgfortran/io/transfer128.c @@ -61,18 +61,17 @@ extern void transfer_complex128_write (st_parameter_dt *, void *, int); export_proto(transfer_complex128_write); -/* Make sure that libquadmath is pulled in. The functions quadmath_strtopQ - and quadmath_dtoaq are weakly referrenced in convert_real and write_float; - the pointer assignment with USED attribute make sure that there is a - non-weakref dependence if the quadmath functions are used. That avoids - segfault when libquad is statically linked. */ +/* Make sure that libquadmath is pulled in. The functions strtoflt128 + and quadmath_flt128tostr are weakly referrenced in convert_real and + write_float; the pointer assignment with USED attribute make sure + that there is a non-weakref dependence if the quadmath functions + are used. That avoids segfault when libquadmath is statically linked. */ +static void __attribute__((used)) *tmp1 = strtoflt128; +static void __attribute__((used)) *tmp2 = quadmath_flt128tostr; void transfer_real128 (st_parameter_dt *dtp, void *p, int kind) { - static void __attribute__((used)) *tmp1 = quadmath_strtopQ; - static void __attribute__((used)) *tmp2 = quadmath_dtoaq; - transfer_real (dtp, p, kind); } @@ -80,9 +79,6 @@ transfer_real128 (st_parameter_dt *dtp, void *p, int kind) void transfer_real128_write (st_parameter_dt *dtp, void *p, int kind) { - static void __attribute__((used)) *tmp1 = quadmath_strtopQ; - static void __attribute__((used)) *tmp2 = quadmath_dtoaq; - transfer_real (dtp, p, kind); } @@ -90,9 +86,6 @@ transfer_real128_write (st_parameter_dt *dtp, void *p, int kind) void transfer_complex128 (st_parameter_dt *dtp, void *p, int kind) { - static void __attribute__((used)) *tmp1 = quadmath_strtopQ; - static void __attribute__((used)) *tmp2 = quadmath_dtoaq; - transfer_complex (dtp, p, kind); } @@ -100,9 +93,6 @@ transfer_complex128 (st_parameter_dt *dtp, void *p, int kind) void transfer_complex128_write (st_parameter_dt *dtp, void *p, int kind) { -/* static void __attribute__((used)) *tmp1 = quadmath_strtopQ; - static void __attribute__((used)) *tmp2 = quadmath_dtoaq;*/ - transfer_complex_write (dtp, p, kind); } #endif diff --git a/libgfortran/io/write_float.def b/libgfortran/io/write_float.def index fc00491..d5bb346 100644 --- a/libgfortran/io/write_float.def +++ b/libgfortran/io/write_float.def @@ -975,7 +975,7 @@ sprintf (buffer, "%+-#" STR(MIN_FIELD_WIDTH) ".*" \ #if defined(GFC_REAL_16_IS_FLOAT128) #define DTOAQ \ -__qmath_(quadmath_dtoaq) (buffer, size, ndigits - 1, tmp); +__qmath_(quadmath_flt128tostr) (buffer, size, ndigits - 1, tmp); #endif #define WRITE_FLOAT(x,y)\ |