public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* A new test case
@ 1998-02-11 17:22 H.J. Lu
  1998-02-11 22:28 ` Jeffrey A Law
  0 siblings, 1 reply; 6+ messages in thread
From: H.J. Lu @ 1998-02-11 17:22 UTC (permalink / raw)
  To: egcs

This test failed on both egcs 1.0.1 and egcs 1.0.2 under Linux/x86.


-- 
H.J. Lu (hjl@gnu.org)
---
Wed Feb 11 17:09:18 1998  H.J. Lu  (hjl@gnu.org)

	* gcc.c-torture/execute/980211-1.c: New to test long double.

--- /dev/null	Wed Dec 31 16:00:00 1969
+++ gcc.c-torture/execute/980211-1.c	Wed Feb 11 17:09:00 1998
@@ -0,0 +1,22 @@
+__inline int
+__signbitl (long double __x)
+{
+  union { long double __l; int __i[3]; } __u = { __l: __x };
+
+  return (__u.__i[2] & 0x8000) != 0;
+}
+
+void
+foo (long double x, long double y)
+{
+  long double z = x / y;
+  if (__signbitl (x) && __signbitl (z))
+    abort ();
+}
+
+int main()
+{
+  if (sizeof (long double) > sizeof (double))
+    foo (-0.0, -1.0);
+  return 0;
+}

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

* Re: A new test case
  1998-02-11 17:22 A new test case H.J. Lu
@ 1998-02-11 22:28 ` Jeffrey A Law
  1998-02-12  2:36   ` Richard Henderson
  0 siblings, 1 reply; 6+ messages in thread
From: Jeffrey A Law @ 1998-02-11 22:28 UTC (permalink / raw)
  To: H.J. Lu; +Cc: egcs

  In message < m0y2nDk-0004ecC@ocean.lucon.org >you write:
  > This test failed on both egcs 1.0.1 and egcs 1.0.2 under Linux/x86.
  > 
  > 
  > -- 
  > H.J. Lu (hjl@gnu.org)
  > ---
  > Wed Feb 11 17:09:18 1998  H.J. Lu  (hjl@gnu.org)
  > 
  > 	* gcc.c-torture/execute/980211-1.c: New to test long double.
Is this test even correct for a big endian target?   In particular
the code in signbitl looks bogus at first glance.

jeff

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

* Re: A new test case
  1998-02-11 22:28 ` Jeffrey A Law
@ 1998-02-12  2:36   ` Richard Henderson
  1998-02-12  6:42     ` H.J. Lu
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Henderson @ 1998-02-12  2:36 UTC (permalink / raw)
  To: law; +Cc: H.J. Lu, egcs

On Wed, Feb 11, 1998 at 11:12:17PM -0700, Jeffrey A Law wrote:
>   > 	* gcc.c-torture/execute/980211-1.c: New to test long double.
> Is this test even correct for a big endian target?   In particular
> the code in signbitl looks bogus at first glance.

No, it is in fact only correct for little-endian targets
that use ieee754 extended format for long double.

To my knowledge this is i386 and i860 only.


r~

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

* Re: A new test case
  1998-02-12  2:36   ` Richard Henderson
@ 1998-02-12  6:42     ` H.J. Lu
  1998-02-13  2:28       ` Jeffrey A Law
  0 siblings, 1 reply; 6+ messages in thread
From: H.J. Lu @ 1998-02-12  6:42 UTC (permalink / raw)
  To: rth; +Cc: egcs

> 
> On Wed, Feb 11, 1998 at 11:12:17PM -0700, Jeffrey A Law wrote:
> >   > 	* gcc.c-torture/execute/980211-1.c: New to test long double.
> > Is this test even correct for a big endian target?   In particular
> > the code in signbitl looks bogus at first glance.
> 
> No, it is in fact only correct for little-endian targets
> that use ieee754 extended format for long double.
> 
> To my knowledge this is i386 and i860 only.
> 

I can add ifdef for i386/i860 if necessary. If someone can write a
better one, it will be great. I just want it to be in egcs so that
it will be fixed before 1.0.2. BTW, gcc 2.8.0 and egcs 980122
are fine.

Thanks.


-- 
H.J. Lu (hjl@gnu.org)

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

* Re: A new test case
  1998-02-12  6:42     ` H.J. Lu
@ 1998-02-13  2:28       ` Jeffrey A Law
  1998-02-13 10:31         ` H.J. Lu
  0 siblings, 1 reply; 6+ messages in thread
From: Jeffrey A Law @ 1998-02-13  2:28 UTC (permalink / raw)
  To: H.J. Lu; +Cc: rth, egcs

  In message < m0y2zqT-0004ecC@ocean.lucon.org >you write:
  > > 
  > > On Wed, Feb 11, 1998 at 11:12:17PM -0700, Jeffrey A Law wrote:
  > > >   > 	* gcc.c-torture/execute/980211-1.c: New to test long double.
  > > > Is this test even correct for a big endian target?   In particular
  > > > the code in signbitl looks bogus at first glance.
  > > 
  > > No, it is in fact only correct for little-endian targets
  > > that use ieee754 extended format for long double.
  > > 
  > > To my knowledge this is i386 and i860 only.
  > > 
  > 
  > I can add ifdef for i386/i860 if necessary. If someone can write a
  > better one, it will be great. I just want it to be in egcs so that
  > it will be fixed before 1.0.2. BTW, gcc 2.8.0 and egcs 980122
  > are fine.
I'd really prefer not to go #ifdefing the testsuite like that.

Is there some other way to test for the bug?  It looks like you're
just peeking at the sign bit, why can't you write the test so that
it checks a value against zero to determine its sign.

And just because it's in the testsuite doesn't mean it will be fixed
for 1.0.2.  1.0.2 is for critical bugs only.  You've said nothing about 
when this bug occurs and thus we can't judge how serious it is.

jeff

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

* Re: A new test case
  1998-02-13  2:28       ` Jeffrey A Law
@ 1998-02-13 10:31         ` H.J. Lu
  0 siblings, 0 replies; 6+ messages in thread
From: H.J. Lu @ 1998-02-13 10:31 UTC (permalink / raw)
  To: law; +Cc: egcs

> 
> Is there some other way to test for the bug?  It looks like you're
> just peeking at the sign bit, why can't you write the test so that
> it checks a value against zero to determine its sign.
> 
> And just because it's in the testsuite doesn't mean it will be fixed
> for 1.0.2.  1.0.2 is for critical bugs only.  You've said nothing about 
> when this bug occurs and thus we can't judge how serious it is.
> 

I have sent a patch for it. Please check out my message for
"An important patch for egcs 1.0.1."

-- 
H.J. Lu (hjl@gnu.org)

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

end of thread, other threads:[~1998-02-13 10:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-02-11 17:22 A new test case H.J. Lu
1998-02-11 22:28 ` Jeffrey A Law
1998-02-12  2:36   ` Richard Henderson
1998-02-12  6:42     ` H.J. Lu
1998-02-13  2:28       ` Jeffrey A Law
1998-02-13 10:31         ` H.J. Lu

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).