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 <[email protected]> - 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) _______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel
