We should backport this enhancement to benefit Clang:
Author: Adhemerval Zanella <firstname.lastname@example.org>
Date: Fri Feb 1 10:39:57 2019 -0200
math: Enable some math builtins for clang
This patch enable the builtin usage for clang for the C99 functions
fpclassify, isfinite, isnormal, isnan, isinf, and sigbit. This allows
clang optimize the calls on frontend instead of call the appropriate
Checked on aarch64-linux-gnu and x86_64-linux-gnu. I checked the supported
version for each builtin based on released version from clang/llvm.
* math/math.h (fpclassify, isfinite, isnormal, isnan): Use builtin for
(signbit): Use builtin for clang 3.3.
(isinf): Use builtin for clang 3.7.
This should also be backported into Fedora 30+.
Verified, glibc uses __builtin versions of fpclassify signbit isfinite isnormal isnan isinf functions with clang.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.