http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59424
--- Comment #3 from Jean-Marc Valin <jmvalin at jmvalin dot ca> --- What's strange is that adding -ffast-math makes gcc use maxss on func3() too, even though it was already allowed to without -ffast-math. I had the same problem with absolute value, although in that case fabs() solved the problem. In the case of max(), using fmax() doesn't help because it's too strict about NaN behaviour to match maxss.