re PR c/30013 (Multiple flaws in decimal floating-point arithmetic conversions fixed)
authorJanis Johnson <janis187@us.ibm.com>
Tue, 11 Sep 2007 01:11:16 +0000 (01:11 +0000)
committerJanis Johnson <janis@gcc.gnu.org>
Tue, 11 Sep 2007 01:11:16 +0000 (01:11 +0000)
commitf3d110ef046e4dd98a82ba8a6365427181c16b1e
tree200c6b2a83392535448b0fad1e529f6969081b6a
parent9fc777ad2561e542ef0eec9d94ee8cb5edc68554
re PR c/30013 (Multiple flaws in decimal floating-point arithmetic conversions fixed)

gcc/
PR c/30013
* config/dfp-bit.c: Don't skip TFmode conversions; move strto*
declarations to top.
(DFP_TO_BFP): Use for either XFmode or TFmode.
(BFP_TO_DFP): Use for either XFmode or TFmode; always use cast
of BFP_VIA_TYPE.
* config/dfp-bit.h: Include float.h.
(LONG_DOUBLE_HAS_XF_MODE, LONG_DOUBLE_HAS_TF_MODE): Define if long
double is one of these modes, rather than using LIBGCC_HAS_*F_MODE
which doesn't mean the same thing.
(BFP_KIND): Use 4 to mean TFmode.
(BFP_FMT): Specify the number of decimal digits based on the
number of mantissa digits.
(BFP_VIA_TYPE): Binary float type to use as cast for sprintf.
(BFP_TO_DFP, DFP_TO_BFP): Define names for TFmode variants.
(STR_TO_BFP): Use strtold for XFmode or TFmode.
(TFtype): Define if TFmode is supported.
* doc/libgcc.texi (Decimal float library routines): Document
TF conversion functions.

gcc/testsuite/
* gcc.dg/dfp/convert-bfp.c: Replace SKIP_LONG_DOUBLE with runtime
checks for size of long double.
* gcc.dg/dfp/convert.h: New file.
* gcc.dg/dfp/convert-bfp-2.c: New test.
* gcc.dg/dfp/convert-bfp-3.c: Ditto.
* gcc.dg/dfp/convert-bfp-4.c: Ditto.
* gcc.dg/dfp/convert-bfp-5.c: Ditto.
* gcc.dg/dfp/convert-bfp-6.c: Ditto.
* gcc.dg/dfp/convert-bfp-7.c: Ditto.
* gcc.dg/dfp/convert-bfp-8.c: Ditto.
* gcc.dg/dfp/convert-bfp-9.c: Ditto.
* gcc.dg/dfp/convert-bfp-10.c: Ditto.
* gcc.dg/dfp/convert-bfp-11.c: Ditto.

From-SVN: r128361
17 files changed:
gcc/ChangeLog
gcc/config/dfp-bit.c
gcc/config/dfp-bit.h
gcc/doc/libgcc.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/dfp/convert-bfp-10.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/dfp/convert-bfp-11.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/dfp/convert-bfp-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/dfp/convert-bfp-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/dfp/convert-bfp-4.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/dfp/convert-bfp-5.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/dfp/convert-bfp-6.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/dfp/convert-bfp-7.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/dfp/convert-bfp-8.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/dfp/convert-bfp-9.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/dfp/convert-bfp.c
gcc/testsuite/gcc.dg/dfp/convert.h [new file with mode: 0644]