https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105376

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jsm28 at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
(gdb) p debug_rtx (rtl)
(const_double:TD -2.0e+0 [-0x0.8p+2])

but CONST_DOUBLE_REAL_VALUE (rtl) has ->recimal == false, and that's true even
on
the tree level.  Generated by

/* Convert x+x into x*2.  */
(simplify
 (plus @0 @0)
 (if (SCALAR_FLOAT_TYPE_P (type))
  (mult @0 { build_real (type, dconst2); })
  (if (INTEGRAL_TYPE_P (type))
   (mult @0 { build_int_cst (type, 2); }))))

where indeed the dconst2 is not decimal.  I have no idea how to create a DFP
constant, but I guess that in priciple (at least for dconst2), creating
the constant with double_type_node and then fold-converting to type might work?
It just looks like a bit much of work ...

Joseph, do you have any insights here?  The above is of course copied from
fold-const.cc originally.

Reply via email to