[Bug c/59424] Optimization issue on min/max

2013-12-09 Thread jmvalin at jmvalin dot ca
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59424 --- Comment #3 from Jean-Marc Valin --- 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

[Bug c/59424] New: Optimization issue on min/max

2013-12-08 Thread jmvalin at jmvalin dot ca
Assignee: unassigned at gcc dot gnu.org Reporter: jmvalin at jmvalin dot ca gcc seems to be having problems optimizing float min/max code and behaves unpredictably. If I compile the following code on an x86-64 (SSE enabled): #include float func1(float a, float b) { return (a < b ? a