https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108922
--- Comment #15 from Alexander Monakov <amonakov at gcc dot gnu.org> --- That is the fancy-error-handling path that is reached under _LIB_VERSION != _IEEE_. Before glibc-2.27, linking with -lieee would set _LIB_VERSION = _IEEE_, and then glibc would use the fprem[1] instruction without any special-casing. musl libc does not implement errno setting for math functions, and always uses fprem directly; likewise for Apple libm: https://github.com/apple-oss-distributions/Libm/blob/17a5f9daa3f5679f7536b26f133b40cc078753c3/Source/Intel/fmod.s