https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104865

--- Comment #5 from Maciej W. Rozycki <macro at orcam dot me.uk> ---
Wrong question then.  Should `__builtin_nan' even compile on non-IEEE-754
FP targets that don't have a qNaN?  And I'll reply to myself.

According to our manual:

"-- Built-in Function: double __builtin_nan (const char *str)
     This is an implementation of the ISO C99 function 'nan'."

and then according to ISO C99:

"The nan functions return a quiet NaN, if available, with content
indicated through tagp.  If the implementation does not support quiet
NaNs, the functions return zero."

so firstly __builtin_isnan(__builtin_nan("")) is supposed to return 0
with the VAX target (because obviously 0.0 is not a NaN), and secondly
the compiled program is wrong as `_ZL3nan' is supposed to be set to
all-zeros (which is the representation of 0.0 datum with the VAX
floating-point format), and then `c1' and `c2' must likewise be both 0.

Both asserts are supposed to fail with the VAX target then (and similarly
PDP-11, which has a similar FP format).

Reply via email to