User account creation filtered due to spam.

Bug 15290 - __float128 failed to pass to function properly
Summary: __float128 failed to pass to function properly
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.4.1
: P2 normal
Target Milestone: 3.4.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-05 07:04 UTC by H.J. Lu
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build: x86_64-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2004-05-05 07:04:26 UTC
[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]$
Comment 1 H.J. Lu 2004-05-05 18:08:58 UTC
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2004-05/msg00263.html
Comment 2 H.J. Lu 2004-05-05 18:56:22 UTC
An alternative is posted at

http://gcc.gnu.org/ml/gcc-patches/2004-05/msg00271.html
Comment 3 CVS Commits 2004-05-05 20:17:15 UTC
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

Comment 4 CVS Commits 2004-05-05 20:19:29 UTC
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

Comment 5 Andrew Pinski 2004-05-05 21:41:32 UTC
Fixed for 3.4.1.