[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Request for "fix float to u64 intrinsics"
From: |
Vincent Lefevre |
Subject: |
Re: [Tinycc-devel] Request for "fix float to u64 intrinsics" |
Date: |
Sun, 13 Sep 2020 02:29:02 +0200 |
User-agent: |
Mutt/1.14.5+76 (bb407ec3) vl-127292 (2020-06-24) |
On 2020-09-11 18:01:36 +0200, Vincent Lefevre wrote:
> On 2020-09-11 11:11:47 +0000, Kyryl Melekhin wrote:
> > If this is undefined behavior, then this line is straight up also UB.
> > https://repo.or.cz/tinycc.git/blobdiff/55f8963dfab5c543f7f34589d3ef9d3f2da3db14..310e3b428cfd181b51723276e6563b90d670da06:/tccgen.c
> > And because that line is UB, then it causes even more bugs down the drain.
> > At least if the output for this UB matches what other compilers generate
> > some bugs can be eliminated.
>
> Note that the output of some compilers may depend on the context
> and optimizations. IIRC, there was a bug in PARI with such a
> conversion.
FYI, this was the bug fixed in this commit:
https://pari.math.u-bordeaux.fr/cgi-bin/gitweb.cgi?p=pari.git;a=commit;h=f7de74a4677c9125020fa28c55dcc04b7f85f7f9
(16 years ago). I don't know which compiler was used (probably GCC),
but ia64, alpha, amd64, hppa64 and sparc64 all gave different answers
on some test code.
--
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)