This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/71026] Missing division optimizations


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.)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]