You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect NaN payload and signaling behavior in __builtin_nan / __builtin_nans #548
The way we currently process NaN values is wrong in both GNU and MSVC mode. In GNU mode we cast doubles into floats and lose bits in the process which changes the value. In MSVC mode we set the quiet bit incorrectly for doubles and leave type conversion up to host C standard library which is lossy.
Reproducing Source Code
constexprdouble value = __builtin_nans("0xFFFFFFFFFFFF");
static_assert(__builtin_bit_cast(unsignedlonglong, value) ==
0x7FF0FFFFFFFFFFFFULL);
Command-line Options
--c++20 --gnu_version=110400
Type of Issue
[Front End] This code SHOULD compile with these options.
Additional Details
No response
Reproducing (Standard) Configuration(s)
No response
Reproducing (Non-standard) Configuration
No response
I acknowledge that:
I have checked open issues and existing discussions before filing this report.
The reproducing source code that I have provided does not depend on headers that I have not included with my submission.
I have reduced the reproducing source code to the best of my ability.
I have selected at least one standard configuration or uploaded a non-standard configuration dump.
I understand code shared via this form is NOT confidential.
I have permission to share the reproducing source code and grant permission for the project to use the source code (or derivatives of the source code) to create tests.
I agree that any tests created using the reproducing source code (or deriatives of it) will be licensed under project license unless I included a LICENSE.txt file in my .zip or .tar.gz upload. If I included a LICENSE.txt file, any tests created using the reproducing source code will be governed by the terms of the license I provided instead.
Activity