[Top][All Lists]

[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: Fri, 11 Sep 2020 18:01:36 +0200
User-agent: Mutt/1.14.4+72 (e807360d) vl-127292 (2020-06-21)

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

> But what gets me the most is why doesn't gcc or clang compiler warn
> on any of this.

Yes, surprising.

> Also how come we can't represent a 32 bit float in a 64 bit number?
> On x86_64 we sure can.

This depends on the value. With a large exponent, the value will
not be representable.

> Then you are citing ISO 17 while we don't even have full support for
> C11.

I have cited the latest version to mean that this has not changed.
This has been like in previous versions of the standard too.

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)

reply via email to

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