[flint] 01/01: Add __volatile__ to asm(div), fixes FLINT-ARB test failure

Ximin Luo infinity0 at debian.org
Wed Oct 25 12:46:30 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository flint.

commit 0133fc7bb2ff52c6fd31c4df013a8b70428c728e
Author: Ximin Luo <infinity0 at debian.org>
Date:   Wed Oct 25 14:45:52 2017 +0200

    Add __volatile__ to asm(div), fixes FLINT-ARB test failure
---
 debian/patches/asm_volatile_div.patch | 27 +++++++++++++++++++++++++++
 debian/patches/series                 |  1 +
 2 files changed, 28 insertions(+)

diff --git a/debian/patches/asm_volatile_div.patch b/debian/patches/asm_volatile_div.patch
new file mode 100644
index 0000000..dcdaa8a
--- /dev/null
+++ b/debian/patches/asm_volatile_div.patch
@@ -0,0 +1,27 @@
+Description: Add __volatile__ to asm(div)
+ This fixes the flint-arb issue on x86-64. If that appears on other
+ architectures, then we need to also patch the asm(div)s for other arches.
+ .
+ See the GCC bug for a detailed explanation of this patch.
+ .
+ A more complete version of this patch is being discussed with GMP devs,
+ which will need to be upstreamed to FLINT when finalised. Their ML is slow
+ but hopefully it will appear here soon:
+ .
+ https://gmplib.org/list-archives/gmp-bugs/2017-October/thread.html
+Author: Ximin Luo <infinity0 at debian.org>
+Bug: https://github.com/fredrik-johansson/arb/issues/194
+Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82677#c9
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/longlong.h
++++ b/longlong.h
+@@ -65,7 +65,7 @@
+        : "%0" ((mp_limb_t)(u)), "rm" ((mp_limb_t)(v)))
+ 
+ #define udiv_qrnnd(q, r, n1, n0, dx)                                            \
+-  __asm__ ("divq %4"                                                            \
++  __asm__ __volatile__ ("divq %4"                                                            \
+        : "=a" (q), "=d" (r)                                                     \
+        : "0" ((mp_limb_t)(n0)), "1" ((mp_limb_t)(n1)), "rm" ((mp_limb_t)(dx)))
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 41f4f0c..8e3e306 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ hurd
 use_clz_builtins_for_mips.patch
 PIE-FTBFS.patch
 undef_count_leading_zeros.patch
+asm_volatile_div.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/flint.git



More information about the debian-science-commits mailing list