math: avoid runtime conversions of floating-point constants
authorSzabolcs Nagy <nsz@port70.net>
Fri, 4 Feb 2022 20:04:45 +0000 (21:04 +0100)
committerRich Felker <dalias@aerifal.cx>
Tue, 8 Mar 2022 21:27:15 +0000 (16:27 -0500)
commit7c0c7a75ec8ecf3eedefc40bb4dae5aaa76d7108
treec787eb03223648195b3b96174cdadc1e0556f382
parentf8bdc3048216f41eaaf655524fa286cfb1184a70
math: avoid runtime conversions of floating-point constants

gcc-12 with -frounding-mode will do inexact constant conversions at
runtime according to the runtime rounding mode.

in the math library we want constants to be rounding mode independent
so this patch fixes cases where new runtime conversions happen with
gcc-12.

fortunately this only affects two minor cases, the fix uses global
initializers where rounding mode does not apply.

after the patch the same amount of conversions happen with gcc-12 as
with gcc-11.
src/complex/cacosf.c
src/complex/catanf.c