public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Irix6 long doubles implemented wrong?  (27_io/ostream_inserter_arith)
@ 2002-12-14 14:09 Kaveh R. Ghazi
  2002-12-16  9:24 ` Rainer Orth
  2002-12-16  9:51 ` Alexandre Oliva
  0 siblings, 2 replies; 72+ messages in thread
From: Kaveh R. Ghazi @ 2002-12-14 14:09 UTC (permalink / raw)
  To: gcc-bugs, gcc; +Cc: libstdc++, oldham, ro

I'm getting wierd (i.e. I think wrong) results for long doubles on
mips-irix6.  Consider the following C testcase:

#include <stdio.h>
int main()
{
  char buf[1024];
  long double ldin[] = { 1.0L, 1.0L, 1.0L };
  long double ldout[3];

  fprintf (stdout, "sizeof(long double) == %d\n", (int) sizeof ldin[0]);
  sprintf (buf, "%Lf %Lf %Lf", ldin[0], ldin[1], ldin[2]);
  sscanf (buf, "%Lf %Lf %Lf", &ldout[0], &ldout[1], &ldout[2]);
  fprintf (stdout, "<%Lf><%Lf><%Lf>\n", ldout[0], ldout[1], ldout[2]);
  return 0;
}

Compiling and then running this program with "cc -n32" or "cc -64" on
irix6.2 or irix6.5 (correctly I believe for these ABIs) yields:

 > sizeof(long double) == 16
 > <1.000000><1.000000><1.000000>

Compiling and then running this program with "gcc -mabi=n32" or
"gcc -mabi=64" on irix6.2 or irix6.5 (erroneously) yields:

 > sizeof(long double) == 8
 > <1.000000><0.000000><-nan0xffffffff>
 > Bus error (core dumped)

This appears to occur for all gcc versions from 2.8.1 through the
current CVS trunk.

As you can see, gcc's sizeof (long double) doesn't agree with that
from the system compiler and I would assume therefore that gcc also
disagrees with libc's notion of long double.  This means that the %Lf
specifier is hosed and cannot be used from gcc on irix6.

I believe this is the cause of the 27_io/ostream_inserter_arith.cc
failures we've been getting on irix6.

See also http://gcc.gnu.org/ml/gcc-bugs/2001-08/msg00088.html which
apears to be the same issue.

Does anyone have any thoughts on this?  (Or better yet a fix?)

		Thanks,
		--Kaveh
--
Kaveh R. Ghazi			ghazi@caip.rutgers.edu

^ permalink raw reply	[flat|nested] 72+ messages in thread
* RE: Irix6 long doubles implemented wrong?  (27_io/ostream_inserter_arith)
@ 2002-12-17  0:18 Billinghurst, David (CRTS)
  0 siblings, 0 replies; 72+ messages in thread
From: Billinghurst, David (CRTS) @ 2002-12-17  0:18 UTC (permalink / raw)
  To: Kaveh R. Ghazi, aoliva; +Cc: gcc, libstdc++

I'd prefer that it was correct, even if this means breaking the gcc ABI.

-----Original Message-----
From: Kaveh R. Ghazi [mailto:ghazi@caip.rutgers.edu]
Sent: Tuesday, 17 December 2002 4:32 PM
To: aoliva@redhat.com
Cc: gcc-bugs@gcc.gnu.org; gcc@gcc.gnu.org; libstdc++@gcc.gnu.org;
oldham@codesourcery.com; ro@TechFak.Uni-Bielefeld.DE
Subject: Re: Irix6 long doubles implemented wrong?
(27_io/ostream_inserter_arith)


 > From: Alexandre Oliva <aoliva@redhat.com>
 > 
 > On Dec 14, 2002, "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> wrote:
 > 
 > > Does anyone have any thoughts on this?  (Or better yet a fix?)
 > 
 > I've been working on a patch that will enable us to switch to 128-bit
 > long doubles on mips n32 and n64, but I still need a little bit of
 > polishing and checking (I know that my current patch still doesn't
 > pass long double arguments in the right registers).  I expect to have
 > it finished in the next few days.

Excellent!  Let me know if I can be of service testing your patch.


 > That said, I'm not sure it would be wise to break the gcc ABI on IRIX
 > 6 by introducing this change.  It's not like long double is the most
 > widely used type, but still, I'm a bit concerned about changing it.
 > Opinions?

Considering the current irix libc incompatibility, one cannot
currently input or output long doubles using stdio.  What good is
that? :-)

I definitely support fixing the ABI, perhaps even on the 3.3 branch if
the patch is not too invasive.

		Thanks,
		--Kaveh
--
Kaveh R. Ghazi			ghazi@caip.rutgers.edu

^ permalink raw reply	[flat|nested] 72+ messages in thread

end of thread, other threads:[~2003-02-03 16:37 UTC | newest]

Thread overview: 72+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-14 14:09 Irix6 long doubles implemented wrong? (27_io/ostream_inserter_arith) Kaveh R. Ghazi
2002-12-16  9:24 ` Rainer Orth
2002-12-16  9:51 ` Alexandre Oliva
2002-12-16  9:52   ` Rainer Orth
2002-12-16 12:23     ` Eric Christopher
2002-12-16 21:58   ` Kaveh R. Ghazi
2002-12-21 10:45     ` Alexandre Oliva
2002-12-22  6:02       ` Kaveh R. Ghazi
2002-12-22 10:24       ` Alexandre Oliva
2002-12-22 10:35         ` Alexandre Oliva
2002-12-23  9:46         ` Alexandre Oliva
2002-12-24 11:07           ` Kaveh R. Ghazi
2002-12-25  8:04             ` Alexandre Oliva
2002-12-26 13:48               ` Alexandre Oliva
2002-12-27  7:06                 ` Alexandre Oliva
2002-12-29  0:22                   ` Kaveh R. Ghazi
2002-12-29  6:06                     ` Alexandre Oliva
2003-01-07 22:57                   ` Richard Henderson
2003-01-08 18:16                     ` Alexandre Oliva
2003-01-08 22:19                       ` Richard Henderson
2003-01-09  9:29                         ` Alexandre Oliva
2003-01-09  9:38                           ` Alexandre Oliva
2003-01-10  1:18                     ` Alexandre Oliva
2003-01-10  2:29                       ` Richard Henderson
2003-01-19 21:02                         ` Kaveh R. Ghazi
2003-01-19 22:15                           ` Alexandre Oliva
2003-01-26 13:00                             ` Alexandre Oliva
2003-01-28 17:32                               ` Alexandre Oliva
2003-01-28 23:38                                 ` Alexandre Oliva
2003-01-26 15:20                             ` Alexandre Oliva
2003-01-26 16:14                               ` Alexandre Oliva
2003-01-26 18:40                                 ` Kaveh R. Ghazi
2003-01-26 21:24                                 ` Kaveh R. Ghazi
2003-01-26 21:25                                   ` Alexandre Oliva
2003-01-27  9:17                                   ` Kaveh R. Ghazi
2003-01-27 10:40                                     ` Alexandre Oliva
2003-01-28  4:52                                       ` Kaveh R. Ghazi
2003-01-28 17:31                                         ` Alexandre Oliva
2003-01-28 19:11                                           ` Kaveh R. Ghazi
2003-01-28 19:23                                             ` Kaveh R. Ghazi
2003-01-28 19:47                                               ` Rainer Orth
     [not found]                                               ` <15926.49701.3! 59482.666471@xayide.TechFak.Uni-Bielefeld.DE>
2003-01-29  6:56                                                 ` Kaveh R. Ghazi
2003-01-29 10:07                                                   ` Richard Henderson
2003-01-29 13:39                                                     ` Alexandre Oliva
2003-01-29 17:26                                                     ` Kaveh R. Ghazi
2003-01-29 18:10                                                       ` Richard Henderson
2003-01-30 23:31                                                         ` Irix6 native long double libcalls progress report (and problem) Kaveh R. Ghazi
2003-01-30 23:49                                                           ` Richard Henderson
2003-02-03 13:22                                                             ` Alexandre Oliva
2003-01-30  8:05                                                     ` Irix6 long doubles implemented wrong? (27_io/ostream_inserter_arith) Kaveh R. Ghazi
2003-02-03 13:07                                                       ` Alexandre Oliva
2003-02-03 15:18                                                         ` Kaveh R. Ghazi
2003-02-03 16:37                                                           ` Alexandre Oliva
2003-01-27 10:41                                     ` Alexandre Oliva
2003-01-26 21:54                                 ` Richard Henderson
2003-01-10  1:37                     ` Alexandre Oliva
2003-01-26 10:07                     ` Alexandre Oliva
2003-01-26 10:42                     ` Alexandre Oliva
2003-01-26 10:45                     ` Alexandre Oliva
2003-01-26 10:53                     ` Alexandre Oliva
2003-01-26 12:07                     ` Alexandre Oliva
2003-01-26 12:20                     ` Alexandre Oliva
2003-01-26 12:50                     ` Alexandre Oliva
2002-12-24 18:15           ` Kaveh R. Ghazi
2003-01-07 22:16             ` Richard Henderson
2003-01-07 22:40           ` Richard Henderson
2003-01-08 18:04             ` Alexandre Oliva
2003-01-08 22:29               ` Richard Henderson
2003-01-08 22:46                 ` Zack Weinberg
2003-01-08 23:13                   ` Richard Henderson
2003-01-09  7:27                 ` Alexandre Oliva
2002-12-17  0:18 Billinghurst, David (CRTS)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).