[Bug tree-optimization/60540] Don't convert int to float when comparing int with float (double) constant

harald at gigawatt dot nl gcc-bugzilla@gcc.gnu.org
Fri Oct 18 18:21:00 GMT 2019


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

--- Comment #9 from Harald van Dijk <harald at gigawatt dot nl> ---
(In reply to Rich Felker from comment #8)
> So arguments about generality to non-Annex-F C
> environments are not relevant to the topic here.

The comment it was a reply to suggested (possibly unintentionally) that
evaluating (float)16777217 would have undefined behaviour if 16777217 could not
be represented by float. A clarification that no, the standard says it only has
undefined behaviour if it is out of float's range, so GCC cannot optimise on
the assumption that such conversions do not happen, is absolutely relevant to
the topic here.


More information about the Gcc-bugs mailing list