]> git.ipfire.org Git - thirdparty/glibc.git/commit
math: Add optimization barrier to ensure a1 + u.d is not reused [BZ #30664]
authorJohn David Anglin <danglin@gcc.gnu.org>
Tue, 25 Feb 2025 20:57:53 +0000 (15:57 -0500)
committerJohn David Anglin <danglin@gcc.gnu.org>
Tue, 25 Feb 2025 21:00:49 +0000 (16:00 -0500)
commit523f85558152a1b9cced6d669f758c27677775ba
treeee9bafc289f8630f19311fe1b1389aa3fdd8ca0c
parentd6c156c326999f144cb5b73d29982108d549ad8a
math: Add optimization barrier to ensure a1 + u.d is not reused [BZ #30664]

A number of fma tests started to fail on hppa when gcc was changed to
use Ranger rather than EVRP.  Eventually I found that the value of
a1 + u.d in this is block of code was being computed in FE_TOWARDZERO
mode and not the original rounding mode:

    if (TININESS_AFTER_ROUNDING)
      {
        w.d = a1 + u.d;
        if (w.ieee.exponent == 109)
          return w.d * 0x1p-108;
      }

This caused the exponent value to be wrong and the wrong return path
to be used.

Here we add an optimization barrier after the rounding mode is reset
to ensure that the previous value of a1 + u.d is not reused.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
sysdeps/ieee754/dbl-64/s_fma.c