Don't treat rint as setting errno
builtins.def says that rint sets errno, but it looks like this might
be a mistake. C99 says that rint doesn't set errno and the builtins.c
expansion code doesn't try to keep errno up to date.
Perhaps this was because earlier versions of POSIX said that
rint sets errno on overflow:
http://pubs.opengroup.org/onlinepubs/
009695399/functions/rintf.html
However, this is another instance of the observation that "rounding
functions could never overflow" (because anything using exponents
that large is already integral). The page above also says that
differences with C99 are unintentional and the ERANGE clause has
been removed from later versions of POSIX:
http://pubs.opengroup.org/onlinepubs/
9699919799/functions/rint.html
Also, the version of POSIX that lists ERANGE for rint does the same
for nearbyint:
http://pubs.opengroup.org/onlinepubs/
009695399/functions/nearbyintf.html
and we already treat nearbyint as not setting errno. This too has been
clarified in later versions of POSIX:
http://pubs.opengroup.org/onlinepubs/
9699919799/functions/nearbyint.html
Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.
gcc/
* builtins.def (BUILTIN_RINT, BUILTIN_RINTF, BUILTIN_RINTL): Use
ATTR_MATHFN_FPROUNDING rather than ATTR_MATHFN_FPROUNDING_ERRNO.
From-SVN: r229918