This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/81120] __builtin_nansl ("") generates quiet NaN
- From: "danglin at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 17 Jun 2017 22:52:46 +0000
- Subject: [Bug middle-end/81120] __builtin_nansl ("") generates quiet NaN
- Auto-submitted: auto-generated
- References: <bug-81120-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81120
--- Comment #1 from John David Anglin <danglin at gcc dot gnu.org> ---
This seems quite tricky. Conversion changes a signaling nan to a quiet nan:
/* Make resulting NaN value to be qNaN. The caller has the
responsibility to avoid the operation if flag_signaling_nans
is on. */
if (r->cl == rvc_nan)
r->signalling = 0;
But the following results in a signaling nan:
extern int __issignaling (double);
int
main (void)
{
long double sNaN = __builtin_nansl ("");
if (!__issignaling((double)sNaN))
return 1;
return 0;
}