This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/81120] __builtin_nansl ("") generates quiet NaN


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;
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]