This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/39878] gcc 4.3.2 converts Decimal FP constants wrong
- From: "janis at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Jun 2009 22:03:32 -0000
- Subject: [Bug c/39878] gcc 4.3.2 converts Decimal FP constants wrong
- References: <bug-39878-17245@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from janis at gcc dot gnu dot org 2009-06-24 22:03 -------
GCC defines DEC_EVAL_METHOD to be 0: "evaluate all operations just to the range
and precision of the type".
The arithmetic/comparison/conversion functions in libgcc (for DPD, not sure
about BID) use the range and precision of the type, which matches 0.
Except for compile-time constants, use of hardware DFP support for POWER6
matches 1: "evaluate operations [and constants] of type _Decimal32 and
_Decimal64 to the range and precision of the _Decimal64 type, evaluate
_Decimal128 operations [and constants] to the range and precision of the
_Decimal128 type".
Within the compiler, decimal float constants are evaluated and folded using
128-bit precision, which matches 2: "evaluate all operations and constants to
the range and precision of the _Decimal128 type".
We could cop out and set DEC_EVAL_METHOD to -1 (indeterminable) but it would be
better to pick one of the other values and honor it consistently.
--
janis at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bje at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39878