------- Comment #4 from dje at gcc dot gnu dot org 2007-03-12 22:20 ------- I do not believe this is an endian issue. It is a coincidence that the output value looks like the original constant. GCC converts the __builtin_memcpy() into a VIEW_CONVERT_EXPR<double>. The constant is equivalent to a NaN and GCC uses the value CONST_DOUBLE NaN, not the original bits. real.c converts the CONST_DOUBLE NaN into a ieee_double NaN, which happens to look like the value printed. On little endian targets, the words are swapped, which just happens to look like the original constant.
If the VIEW_CONVERT_EXPR<double> is valid, manipulating it like a NaN seems valid. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30704