This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/71026] Missing division optimizations
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 24 Aug 2016 21:34:35 +0000
- Subject: [Bug tree-optimization/71026] Missing division optimizations
- Auto-submitted: auto-generated
- References: <bug-71026-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71026
--- Comment #4 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
On Wed, 24 Aug 2016, ktkachov at gcc dot gnu.org wrote:
> int f4(float x) { return (1.0f / x) < 0.0f; } // -> x < 0.0f
Requires -fno-trapping-math, as this could lose an overflow or underflow
from the division (but provided subnormals are supported, it can't
underflow to zero for IEEE types).
> int f5(float x) { return (x / 2.0f) <= 0.0f; } // -> x <= 0.0f
Requires -funsafe-math-optimizations or similar; this is not a correct
transformation for the least positive subnormal. (In principle, given
-fno-rounding-math -fno-trapping-math, you could convert this to x <=
FLT_TRUE_MIN and be correct.)