------- Additional Comments From jsm28 at gcc dot gnu dot org  2005-05-03 16:33 
-------
Conversion of out-of-range floating point values to integers yields undefined
behavior in both C and C++.  There is no need for it to be consistent between
compile-time and runtime conversions.

However, the ISO C decimal floating point proposals (DTR 24732 / WG14 N1107)
make it well-defined for binary as well as decimal floating-point types.  So we
do want to support well-defined semantics (namely, those in that proposal) for
both compile-time and runtime conversions, at least under a command-line option
to enable them.  I don't know whether dfp-branch has such support yet. 
Performance measurements would be needed to ascertain whether there is any
benefit to having both versions or whether we might as well just always use the
DTR 24732 semantics for these conversions (and document that we are doing so,
and seek out and eliminate any optimizations in the compiler which depend on
such conversions being undefined - a search for such optimizations being a
necessary part of the decimal floating point work anyway if not already done).


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bje at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21360

Reply via email to