[issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot

2017-04-21 Thread Mark Dickinson
Mark Dickinson added the comment: Dimitry: thank you! Indeed, that looks like the very same issue. It's a shame to have to use -fno-strict-aliasing here, since that might prevent legitimate optimisations elsewhere in the code. But if that's what we have to do to maintain correctness with

[issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot

2017-04-20 Thread Ed Maste
Changes by Ed Maste : -- nosy: +emaste ___ Python tracker ___ ___ Python-bugs-list

[issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot

2017-04-20 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +1344 ___ Python tracker ___ ___

[issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot

2017-04-20 Thread Dimitry Andric
Dimitry Andric added the comment: This is most likely the same issue we found in https://bugs.freebsd.org/216770, which was reported upstream to LLVM here: https://bugs.llvm.org//show_bug.cgi?id=31928, and resulted in a very long and not really productive discussion about whether type punning

[issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot

2017-04-20 Thread STINNER Victor
STINNER Victor added the comment: > Why is -ffast-math being used? That seems like it's asking for trouble. Sorry, my comment was unclear: I only tried to list all compiler options which have an impact on floating point numbers. > So this is smelling like a compiler bug to me. Right, I will

[issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot

2017-04-20 Thread Mark Dickinson
Mark Dickinson added the comment: Hmm. Just looked at dto5.c; nice work reducing it to something so simple. This is looking a bit like either a strict-aliasing related problem, or a compiler bug, or both. My understanding of the "union trick" that dtoa.c uses is that it's well-defined under

[issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot

2017-04-20 Thread Mark Dickinson
Mark Dickinson added the comment: Why is -ffast-math being used? That seems like it's asking for trouble. -- ___ Python tracker ___

[issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot

2017-04-20 Thread STINNER Victor
STINNER Victor added the comment: Much simpler test: [haypo@freebsd ~/prog/python/master]$ clang40 -O1 dtoa5.c -o x && ./x k=1 aadj=3.364 test ok [haypo@freebsd ~/prog/python/master]$ clang40 -O2 dtoa5.c -o x && ./x k=1 aadj=1.682 test FAILED: BUG! -- Added file:

[issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot

2017-04-20 Thread STINNER Victor
STINNER Victor added the comment: > Still ok with clang 3.8 with -O1: Sorry, you should read clang 4.0 here. -- ___ Python tracker ___

[issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot

2017-04-20 Thread STINNER Victor
STINNER Victor added the comment: I created a test case: attached dtoa2.c. Ok with GCC 6.3.1 (on Fedora 25) and clang 3.8 (on FreeBSD 11) with -O3: haypo@selma$ gcc -O3 dtoa2.c -o x && ./x text: 29865e170 -> float: 2.9865e+174 0x1.8265ea9f864bcp+579 {bc 64 f8 a9 5e 26 28 64} [haypo@freebsd

[issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot

2017-04-20 Thread STINNER Victor
STINNER Victor added the comment: test_strtod fails on FreeBSD using clang 4.0, but pass using clang 3.8. Links: * https://gcc.gnu.org/wiki/FloatingPointMath * https://gcc.gnu.org/wiki/Math_Optimization_Flags * ICC fp-model: https://software.intel.com/en-us/node/682946 GCC options: *

[issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot

2017-04-19 Thread STINNER Victor
Changes by STINNER Victor : -- components: +Interpreter Core, Tests nosy: +mark.dickinson ___ Python tracker ___

[issue30104] Float rounding errors on AMD64 FreeBSD CURRENT Debug 3.x buildbot

2017-04-19 Thread STINNER Victor
New submission from STINNER Victor: Since the build 154, many tests fail on the AMD64 FreeBSD CURRENT Debug 3.x buildbot slave because of float rounding errors. Failing tests: * test_cmath * test_float * test_json * test_marshal * test_math * test_statistics * test_strtod