tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Fwd: Bug#698351: tcc: FE_INVALID flag not set on comp


From: Thomas Preud'homme
Subject: Re: [Tinycc-devel] Fwd: Bug#698351: tcc: FE_INVALID flag not set on comparison with NAN (unordered)
Date: Sat, 04 Jan 2014 20:59:18 +0800
User-agent: KMail/4.11.3 (Linux/2.6.38-ac2-ac100; KDE/4.11.3; armv7l; ; )

Le vendredi 3 janvier 2014, 13:28:13 Thomas Preud'homme a écrit :
> Le vendredi 3 janvier 2014, 04:54:57 Vincent Lefevre a écrit :
> > Hi Thomas,
> > 
> > On 2014-01-03 10:30:15 +0800, Thomas Preud'homme wrote:
> > > There is quite a few differences in the output about -0.0 where gcc
> > > uses 0.0.
> > > I'm not sure it's worth doing anything to change that since it's not
> > > a bug but less divergence with gcc (and probably clang) could be
> > > good. If it's just a few lines to add, why not. I might take a look
> > > later this month, or never. ;)
> > 
> > Actually I think that this is more than an output bug, but I don't
> > know whether this is related. The fact is that tcc doesn't seem to
> > support signed zeros (required by IEEE 754).
> 
> Oh ok. I didn't look at the code that generated this output. Then I'll try
> to take a look. Maybe not now but I'll keep it on my bug list.

So I decided it could be an easy bug fix and it quite was so it's now fixed. 
There is still some difference on x86 but the output is the same for arm except 
for the fixed NaN comparison.

> 
> > I've updated my program with the following test:
> > 
> > static void signed_zero_inf (void)
> > {
> > 
> >   double x = 0.0, y = -0.0;
> >   
> >   printf ("\n");
> >   if (x == y)
> >   
> >     printf ("Test 1.0 / 0.0 != 1.0 / -0.0 returns %d (should be 1).\n",
> >     
> >             1.0 / x != 1.0 / y);
> >   
> >   else
> >   
> >     printf ("0.0 != -0.0; this is wrong!\n");
> > 
> > }

By the way, would you agree to put your test code under the MIT license as 
tcc? It would be a nice addition to tcc's test suite.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]