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

--- Comment #2 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)

> Well the C standard requires it, though we could optimize it away since
> 32bit integers can be exactly represented in a 64bit IEEE double.

Yes, for doubles, absolutely.

If converting a 32 bit int value to a 32 bit float, the resulting value is
undefined behavior if it can't be represented by a 32 bit float, at least as
far as I know.  If this is the case, it could also be OK to do it for 32 bit
floats, at least when doing unsafe math optimizations.

Reply via email to