From 35ffa87c754391dff98e491e059243afb3e8a0d8 Mon Sep 17 00:00:00 2001 From: Stephane Glondu Date: Fri, 26 Jul 2013 06:15:49 +0200 Subject: [PATCH] Fix (arm) code generation bug with mod 1 --- ...9-Fix-code-generation-bug-with-mod-1.patch | 25 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 26 insertions(+) create mode 100644 debian/patches/0009-Fix-code-generation-bug-with-mod-1.patch diff --git a/debian/patches/0009-Fix-code-generation-bug-with-mod-1.patch b/debian/patches/0009-Fix-code-generation-bug-with-mod-1.patch new file mode 100644 index 00000000..171f87ae --- /dev/null +++ b/debian/patches/0009-Fix-code-generation-bug-with-mod-1.patch @@ -0,0 +1,25 @@ +From: Stephane Glondu +Date: Fri, 26 Jul 2013 06:13:27 +0200 +Subject: Fix code generation bug with "mod 1" + +Backport of a patch from Benedikt Meurer. ocamlnet needs it. + +Bug: http://caml.inria.fr/mantis/view.php?id=5910 +--- + asmcomp/arm/selection.ml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/asmcomp/arm/selection.ml b/asmcomp/arm/selection.ml +index ecda382..ef112ed 100644 +--- a/asmcomp/arm/selection.ml ++++ b/asmcomp/arm/selection.ml +@@ -173,7 +173,7 @@ method! select_operation op args = + | (Cdivi, args) -> + (Iextcall("__aeabi_idiv", false), args) + | (Cmodi, [arg; Cconst_int n]) +- when n = 1 lsl Misc.log2 n -> ++ when n > 1 && n = 1 lsl Misc.log2 n -> + (Iintop_imm(Imod, n), [arg]) + | (Cmodi, args) -> + (* See above for fix up of return register *) +-- diff --git a/debian/patches/series b/debian/patches/series index be80a2c4..52ca655b 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -6,3 +6,4 @@ 0006-Install-ocamlbuild-as-a-link-on-either-.native-or-.b.patch 0007-Avoid-multiple-declarations-in-generated-.c-files-in.patch 0008-Embed-bytecode-in-C-object-when-using-custom.patch +0009-Fix-code-generation-bug-with-mod-1.patch -- 2.30.2