[Bug tree-optimization/110755] [13/14 Regression] Wrong optimization of fabs on ppc64el at -O1

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jul 24 07:12:12 GMT 2023


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110755

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Actually looking at IEEE754, the fix should be limited to +- operations, not
+-*/.
Because only for +- IEEE754 has:
"When the sum of two operands with opposite signs (or the difference of two
operands with like signs) is exactly zero, the sign of that sum (or difference)
shall be +0 in all rounding direction modes except roundTowardNegative; in that
mode, the sign of an exact zero sum (or difference) shall be –0. However, x+x =
x–(–x) retains the same sign as x even when x is zero."


More information about the Gcc-bugs mailing list