aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-02-14 16:34:44 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-02-14 16:34:44 +0100
commit1d92226be3a775b085e90436067c45f938fba761 (patch)
treea69f03ba3c677008fe5633e1a0886cffc77d95b8 /libgfortran
parent944f4bb398aaf3d25c71a5b12ca9626d2c5f5e99 (diff)
downloadgcc-1d92226be3a775b085e90436067c45f938fba761.zip
gcc-1d92226be3a775b085e90436067c45f938fba761.tar.gz
gcc-1d92226be3a775b085e90436067c45f938fba761.tar.bz2
re PR fortran/47642 (real(kind=16) - libquadmath - segfault on amd64 FreeBSD)
PR fortran/47642 * libquadmath.texi (quadmath_snprintf): Document. (quadmath_flt128tostr): Remove. * Makefile.am (libquadmath_la_SOURCES): Add printf/*.c. Remove quadmath_io.c, gdtoa/gdtoa.c, gdtoa/g__fmt.c, gdtoa/g_Qfmt.c, gdtoa/dmisc.c and gdtoa/ulp.c. * quadmath.h (quadmath_snprintf): New prototype. (quadmath_flt128tostr): Remove. * quadmath_weak.h (quadmath_snprintf): Add. (quadmath_flt128tostr): Remove. * configure.ac: New AC_CHECK_HEADERS headers: langinfo.h, wchar.h, wctype.h, limits.h, ctype.h, printf.h, errno.h. (AC_USE_SYSTEM_EXTENSIONS): Add. (HAVE_HIDDEN_VISIBILITY, HAVE_PRINTF_HOOKS, USE_LOCALE_SUPPORT, USE_I18N_NUMBER_H): New checks. * quadmath.map (QUADMATH_1.0): Add quadmath_snprintf. Remove quadmath_flt128tostr. * printf/printf_fphex.c: New file. * printf/_itowa.h: New file. * printf/mul_n.c: New file. * printf/quadmath-printf.h: New file. * printf/submul_1.c: New file. * printf/quadmath-printf.c: New file. * printf/gmp-impl.h: New file. * printf/lshift.c: New file. * printf/fpioconst.h: New file. * printf/add_n.c: New file. * printf/cmp.c: New file. * printf/sub_n.c: New file. * printf/mul.c: New file. * printf/divrem.c: New file. * printf/addmul_1.c: New file. * printf/printf_fp.c: New file. * printf/_itoa.h: New file. * printf/fpioconst.c: New file. * printf/_i18n_number.h: New file. * printf/flt1282mpn.c: New file. * printf/rshift.c: New file. * printf/mul_1.c: New file. * quadmath_io.c: Removed. * gdtoa/gdtoa.c: Removed. * gdtoa/g__fmt.c: Removed. * gdtoa/g_Qfmt.c: Removed. * gdtoa/dmisc.c: Removed. * gdtoa/ulp.c: Removed. * config.h.in: Regenerated. * configure: Regenerated. * Makefile.in: Regenerated. * io/write_float.def (DTOAQ): Use quadmath_snprintf instead of quadmath_flt128tostr. * io/transfer128.c (tmp2): Initialize to quadmath_snprintf instead of quadmath_flt128tostr. From-SVN: r170135
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog8
-rw-r--r--libgfortran/io/transfer128.c6
-rw-r--r--libgfortran/io/write_float.def6
3 files changed, 15 insertions, 5 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index b85a6bf..71a6329 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,11 @@
+2011-02-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/47642
+ * io/write_float.def (DTOAQ): Use quadmath_snprintf instead of
+ quadmath_flt128tostr.
+ * io/transfer128.c (tmp2): Initialize to quadmath_snprintf instead
+ of quadmath_flt128tostr.
+
2011-02-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* Makefile.in: Regenerate.
diff --git a/libgfortran/io/transfer128.c b/libgfortran/io/transfer128.c
index 5690245..d94ccac 100644
--- a/libgfortran/io/transfer128.c
+++ b/libgfortran/io/transfer128.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010
+/* Copyright (C) 2010, 2011
Free Software Foundation, Inc.
This file is part of the GNU Fortran runtime library (libgfortran).
@@ -62,12 +62,12 @@ export_proto(transfer_complex128_write);
/* Make sure that libquadmath is pulled in. The functions strtoflt128
- and quadmath_flt128tostr are weakly referrenced in convert_real and
+ and quadmath_snprintf 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;
+static void __attribute__((used)) *tmp2 = quadmath_snprintf;
void
transfer_real128 (st_parameter_dt *dtp, void *p, int kind)
diff --git a/libgfortran/io/write_float.def b/libgfortran/io/write_float.def
index 21bbfbb..29b8f1f 100644
--- a/libgfortran/io/write_float.def
+++ b/libgfortran/io/write_float.def
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
Contributed by Andy Vaught
Write float code factoring to this file by Jerry DeLisle
F2003 I/O support contributed by Jerry DeLisle
@@ -1000,7 +1000,9 @@ sprintf (buffer, "%+-#" STR(MIN_FIELD_WIDTH) ".*" \
#if defined(GFC_REAL_16_IS_FLOAT128)
#define DTOAQ \
-__qmath_(quadmath_flt128tostr) (buffer, size, ndigits - 1, tmp);
+__qmath_(quadmath_snprintf) (buffer, sizeof buffer, \
+ "%+-#" STR(MIN_FIELD_WIDTH) ".*" \
+ "Qe", ndigits - 1, tmp);
#endif
#define WRITE_FLOAT(x,y)\