On Fri, 7 Jul 2017, Yuri Gribov wrote:

> > I suspect infinities would already work with the patch as-is (the logic
> > dealing with constants outside the range of the integer type).  I'm less
> > clear that NaNs would work properly.  (If the comparison is == or != you
> > can optimize it for quiet NaNs, to false and true respectively.  If it's a
> > signaling NaN, or < <= > >=, optimizing to false is only valid with
> > -fno-trapping-math, as it would lose an "invalid" exception.)
> 
> It's actually under -fsignaling-nans (which if off by default). I've

No, ordered comparisons with qNaNs should result in exceptions, so it's 
not valid by default to optimize them to false (whereas it is valid for 
equality comparisons, as those only raise exceptions for signaling NaNs).

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to