Ben, it's most like what Peter says. I can confirm it works; I just
installed https://cran.r-project.org/src/base-prerelease/R-latest.tar.gz
on an up-to-date CentOS 7.9.2009 system using the vanilla gcc (GCC)
4.8.5 that comes with that version and R compiles just fine and it
passes 'make check' to
I confirm it is valgrind behavior, it does not preserve the NaN payload
when converting 80-bit and 64-bit floating point numbers on Intel (also
it treats denormals as zero, more information is in comments in valgrind
source, file guest_generic_x87.c).
The quick-hack patch below can be applied
I can reproduce on my system, running an unoptimized R build (-O0) in
valgrind produces NaN (valgrind 3.15.0, gcc 9.3.0 - Ubuntu 20.04/x86_64)
for the example, but without valgrind it produces NA.
Valgrind modifies the binary code before running it and this is probably
what is causing the diff