[Bug tree-optimization/57371] Simplify (double)i != 0
glisse at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed May 22 16:30:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57371
--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> ---
Thank you for this very detailed analysis :-)
(In reply to joseph@codesourcery.com from comment #1)
> * If not all values of the integer type can be represented in the
> floating-point type exactly, then the change to an integer comparison
> would lose an "inexact" exception, so not be appropriate with
> -ftrapping-math (strictly interpreted; GCC may not follow that
> consistently).
Indeed. Note that I believe splitting -ftrapping-math=(no|normal|strict), or
maybe even further (I know some people using overflow, but noone who uses the
inexact exception, although there must be a few) would help convince people to
add those checks (I abandoned PR 53805 and PR 53806 in part because it wasn't
clear which one was wanted), and so would making -fno-trapping-math the default
(PR 54192), so we don't fear regressing code speed for default users who don't
care.
More information about the Gcc-bugs
mailing list