News for hackers. Stuff that matters.
Re:Optimizations Enabled by -ffast-Math by heavenlyblue on Wednesday October 20, 2021 @05:22AM (#28928558)
> such as not evaluating either the true or false part of an if-statement

Do you mean `if-else if` or `if-else`? Because the second would work and would always short-circuit to else.

Re:Optimizations Enabled by -ffast-Math by nwallin on Wednesday October 20, 2021 @08:31PM (#28938730)
No. Imagine you have this:

  if (x < 7)
    doSomething();
  else
    doSomethingElse();
With -ffast-math, the compiler is allowed to call neither doSomething() nor doSomethingElse() if x is nan. Which IMHO is not great.
Re:Optimizations Enabled by -ffast-Math by Linosaurus on Wednesday October 20, 2021 @02:45PM (#28934476)
I imagine it means that the compiler could turn an if(x<6)-else into two free standing if statement like if(x<6), if(x>=6). Which will logically work under these assumptions.