On 10/28/26 6:43 AM, Richard Biener wrote:
On Wed, Oct 28, 2026 at 12:29 PM Merlin Warner-Huish
<[email protected]> wrote:
The negated FMA folds in match.pd, such as -fma (a, b, c) -> fnms (a, b, c),
give the wrong sign when a * b + c is exactly zero.  For example,
-fma (1.0, 1.0, -1.0) should be -0.0, since the fma rounds to +0.0 and
is then negated, but fnms (1.0, 1.0, -1.0) computes -1.0 + 1.0, which
rounds to +0.0.

PR116891 already disabled these folds for -frounding-math.  With the
default rounding mode the sign of an exact zero is the only thing that
can differ, so they are also only valid when signed zeros don't matter.
This patch adds a !HONOR_SIGNED_ZEROS check to all four folds and to
their IFN_COND_* versions.  With -fno-signed-zeros the folds still apply.
OK.
And pushed.

Merlin, it probably makes sense for you to go ahead and get commit privs if you're going to continue to work on GCC.

https://gcc.gnu.org/gitwrite.html

Has a link to the form.  List me as you sponsor.

jeff

Reply via email to