From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24086 invoked by alias); 14 Dec 2002 21:46:35 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 24063 invoked from network); 14 Dec 2002 21:46:31 -0000 Received: from unknown (HELO caip.rutgers.edu) (128.6.236.10) by sources.redhat.com with SMTP; 14 Dec 2002 21:46:31 -0000 Received: (from ghazi@localhost) by caip.rutgers.edu (8.9.3/8.9.3) id QAA25890; Sat, 14 Dec 2002 16:45:27 -0500 (EST) Date: Sat, 14 Dec 2002 14:09:00 -0000 From: "Kaveh R. Ghazi" Message-Id: <200212142145.QAA25890@caip.rutgers.edu> To: gcc-bugs@gcc.gnu.org, gcc@gcc.gnu.org Subject: Irix6 long doubles implemented wrong? (27_io/ostream_inserter_arith) Cc: libstdc++@gcc.gnu.org, oldham@codesourcery.com, ro@TechFak.Uni-Bielefeld.DE X-SW-Source: 2002-12/txt/msg00805.txt.bz2 I'm getting wierd (i.e. I think wrong) results for long doubles on mips-irix6. Consider the following C testcase: #include 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