[Bug math/28713] GCC 12 miscompiles libm

cvs-commit at gcc dot gnu.org sourceware-bugzilla@sourceware.org
Mon Jan 10 14:28:53 GMT 2022


https://sourceware.org/bugzilla/show_bug.cgi?id=28713

--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Szabolcs Nagy <nsz@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=347a5b592c91f0230d52a5117fd83e1f75028207

commit 347a5b592c91f0230d52a5117fd83e1f75028207
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Fri Dec 31 09:50:50 2021 +0000

    math: Fix float conversion regressions with gcc-12 [BZ #28713]

    Converting double precision constants to float is now affected by the
    runtime dynamic rounding mode instead of being evaluated at compile
    time with default rounding mode (except static object initializers).

    This can change the computed result and cause performance regression.
    The known correctness issues (increased ulp errors) are already fixed,
    this patch fixes remaining cases of unnecessary runtime conversions.

    Add float M_* macros to math.h as new GNU extension API.  To avoid
    conversions the new M_* macros are used and instead of casting double
    literals to float, use float literals (only required if the conversion
    is inexact).

    The patch was tested on aarch64 where the following symbols had new
    spurious conversion instructions that got fixed:

      __clog10f
      __gammaf_r_finite@GLIBC_2.17
      __j0f_finite@GLIBC_2.17
      __j1f_finite@GLIBC_2.17
      __jnf_finite@GLIBC_2.17
      __kernel_casinhf
      __lgamma_negf
      __log1pf
      __y0f_finite@GLIBC_2.17
      __y1f_finite@GLIBC_2.17
      cacosf
      cacoshf
      casinhf
      catanf
      catanhf
      clogf
      gammaf_positive

    Fixes bug 28713.

    Reviewed-by: Paul Zimmermann <Paul.Zimmermann@inria.fr>

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Glibc-bugs mailing list