[PATCH] math: Fix acosf when building with gcc <= 11

Alexander Monakov amonakov@ispras.ru
Thu Jan 2 14:43:07 GMT 2025


On Thu, 2 Jan 2025, Adhemerval Zanella wrote:

> GCC <= 11 wrongly assumes the rounding is to nearest and performs a
> constant folding where it should evaluate since the result is not
> exact [1].
> 
> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57245

Note that the problematic folding still happens a few lines below the
fixed instance where '+ 0x1p-25' without the 'f' suffix causes the
sum to be evaluated in double precision, and then converted to float.
With 0x1p-25f, gcc doesn't fold the summation.

Alexander


More information about the Libc-alpha mailing list