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: Vincent Lefevre
Subject: Re: [Tinycc-devel] Fwd: Bug#698351: tcc: FE_INVALID flag not set on comparison with NAN (unordered)
Date: Fri, 3 Jan 2014 04:54:57 +0100
User-agent: Mutt/1.5.21-6305-vl-r59709 (2013-04-16)

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

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");
}

GCC is OK:

Test 1.0 / 0.0 != 1.0 / -0.0 returns 1 (should be 1).

(except if one uses -O -ffast-math or equivalent).

But tcc 0.9.25 (Debian/unstable) is not:

Test 1.0 / 0.0 != 1.0 / -0.0 returns 0 (should be 1).

Regards,

-- 
Vincent Lefèvre <address@hidden> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



reply via email to

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