diff options
author | Janis Johnson <janis187@us.ibm.com> | 2006-11-30 17:58:03 +0000 |
---|---|---|
committer | Janis Johnson <janis@gcc.gnu.org> | 2006-11-30 17:58:03 +0000 |
commit | 2a061db501f101bfd33a6897d30431666689ce08 (patch) | |
tree | fab81e8535a653c285625b70442c5203969974c1 /gcc/config | |
parent | 334737afb7f669464b04246783ba48b777f1e809 (diff) | |
download | gcc-2a061db501f101bfd33a6897d30431666689ce08.zip gcc-2a061db501f101bfd33a6897d30431666689ce08.tar.gz gcc-2a061db501f101bfd33a6897d30431666689ce08.tar.bz2 |
dfp-bit.c (DFP_TO_INT): Use wider precision.
gcc/
* config/dfp-bit.c (DFP_TO_INT): Use wider precision.
testsuite/
* gcc.dg/dfp/convert-int-max.c: New test.
* gcc.dg/dfp/convert-int-max-fold.c: New test.
From-SVN: r119368
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/dfp-bit.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/config/dfp-bit.c b/gcc/config/dfp-bit.c index 0d4308e..0ee2083 100644 --- a/gcc/config/dfp-bit.c +++ b/gcc/config/dfp-bit.c @@ -392,7 +392,8 @@ DFP_TO_INT (DFP_C_TYPE x) decNumber qval, n1, n2; decContext context; - decContextDefault (&context, CONTEXT_INIT); + /* Use a large context to avoid losing precision. */ + decContextDefault (&context, DEC_INIT_DECIMAL128); /* Need non-default rounding mode here. */ context.round = DEC_ROUND_DOWN; |