[hjl@gnu-20 float128]$ cat q.c #include <stdio.h> #include <string.h> #include <stdlib.h> #include <endian.h> void foo (__float128 x) { union quad { unsigned char c[16]; __float128 qd; } q; q.qd = x; unsigned char two [16]; memset (two, 0, sizeof two); #if __BYTE_ORDER == __BIG_ENDIAN two [0] = 0x40; #endif #if __BYTE_ORDER == __LITTLE_ENDIAN two [15] = 0x40; #endif if (memcmp (two, q.c, sizeof two) != 0) abort (); } int main () { foo (2); return 0; } [hjl@gnu-20 float128]$ /usr/gcc-3.4/bin/gcc q.c [hjl@gnu-20 float128]$ ./a.out Aborted [hjl@gnu-20 float128]$
A patch is posted at http://gcc.gnu.org/ml/gcc-patches/2004-05/msg00263.html
An alternative is posted at http://gcc.gnu.org/ml/gcc-patches/2004-05/msg00271.html
Subject: Bug 15290 CVSROOT: /cvs/gcc Module name: gcc Changes by: hjl@gcc.gnu.org 2004-05-05 20:17:09 Modified files: gcc : ChangeLog gcc/config/i386: i386.c Log message: 2004-05-05 H.J. Lu <hongjiu.lu@intel.com> PR target/15290 * config/i386/i386.c (ix86_split_to_parts): Use real_to_target instead of REAL_VALUE_TO_TARGET_LONG_DOUBLE. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3580&r2=2.3581 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.c.diff?cvsroot=gcc&r1=1.663&r2=1.664
Subject: Bug 15290 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: hjl@gcc.gnu.org 2004-05-05 20:19:20 Modified files: gcc : ChangeLog gcc/config/i386: i386.c Log message: 2004-05-05 H.J. Lu <hongjiu.lu@intel.com> PR target/15290 * config/i386/i386.c (ix86_split_to_parts): Use real_to_target instead of REAL_VALUE_TO_TARGET_LONG_DOUBLE. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.431&r2=2.2326.2.432 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.635.2.9&r2=1.635.2.10
Fixed for 3.4.1.