[Pkg-ocaml-maint-commits] [ocaml] 02/02: Fix ocamlopt on sparc
Stéphane Glondu
glondu at alioth.debian.org
Fri Nov 8 22:04:05 UTC 2013
This is an automated email from the git hooks/post-receive script.
glondu pushed a commit to branch experimental/master
in repository ocaml.
commit 18649e2b99d7adf3c84fcc299ff6034b78e5610f
Author: Stephane Glondu <steph at glondu.net>
Date: Fri Nov 8 15:04:09 2013 +0100
Fix ocamlopt on sparc
---
debian/patches/0012-Fix-ocamlopt-on-sparc.patch | 77 +++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 78 insertions(+)
diff --git a/debian/patches/0012-Fix-ocamlopt-on-sparc.patch b/debian/patches/0012-Fix-ocamlopt-on-sparc.patch
new file mode 100644
index 0000000..126325d
--- /dev/null
+++ b/debian/patches/0012-Fix-ocamlopt-on-sparc.patch
@@ -0,0 +1,77 @@
+From: Stephane Glondu <steph at glondu.net>
+Date: Fri, 8 Nov 2013 16:42:19 +0100
+Subject: Fix ocamlopt on sparc
+
+Bug: http://caml.inria.fr/mantis/view.php?id=6227
+---
+ asmcomp/interf.ml | 6 +++++-
+ asmcomp/sparc/emit.mlp | 12 ++++++------
+ 2 files changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/asmcomp/interf.ml b/asmcomp/interf.ml
+index 77acb78..eab8a96 100644
+--- a/asmcomp/interf.ml
++++ b/asmcomp/interf.ml
+@@ -115,13 +115,17 @@ let build_graph fundecl =
+
+ (* Add a preference from one reg to another.
+ Do not add anything if the two registers conflict,
+- or if the source register already has a location. *)
++ or if the source register already has a location,
++ or if the two registers belong to different classes.
++ (The last case can occur e.g. on Sparc when passing
++ float arguments in integer registers, PR#6227.) *)
+
+ let add_pref weight r1 r2 =
+ if weight > 0 then begin
+ let i = r1.stamp and j = r2.stamp in
+ if i <> j
+ && r1.loc = Unknown
++ && Proc.register_class r1 = Proc.register_class r2
+ && (let p = if i < j then (i, j) else (j, i) in
+ not (IntPairSet.mem p !mat))
+ then r1.prefer <- (r2, weight) :: r1.prefer
+diff --git a/asmcomp/sparc/emit.mlp b/asmcomp/sparc/emit.mlp
+index b8387cd..258b2ca 100644
+--- a/asmcomp/sparc/emit.mlp
++++ b/asmcomp/sparc/emit.mlp
+@@ -64,7 +64,7 @@ let symbol_prefix =
+ if Config.system = "sunos" then "_" else ""
+
+ let emit_symbol s =
+- if String.length s >= 1 & s.[0] = '.'
++ if String.length s >= 1 && s.[0] = '.'
+ then emit_string s
+ else begin emit_string symbol_prefix; Emitaux.emit_symbol '$' s end
+
+@@ -629,8 +629,8 @@ let is_one_instr i =
+ i.arg.(0).typ <> Float && i.res.(0).typ <> Float
+ | Iconst_int n -> is_native_immediate n
+ | Istackoffset _ -> true
+- | Iload(_, Iindexed n) -> i.res.(0).typ <> Float & is_immediate n
+- | Istore(_, Iindexed n) -> i.arg.(0).typ <> Float & is_immediate n
++ | Iload(_, Iindexed n) -> i.res.(0).typ <> Float && is_immediate n
++ | Istore(_, Iindexed n) -> i.arg.(0).typ <> Float && is_immediate n
+ | Iintop(op) -> is_one_instr_op op
+ | Iintop_imm(op, _) -> is_one_instr_op op
+ | Iaddf | Isubf | Imulf | Idivf -> true
+@@ -660,15 +660,15 @@ let rec emit_all i =
+ emit_instr i.next (Some i);
+ emit_all i.next.next
+ | {next = {desc = Lop(Itailcall_imm s)}}
+- when s = !function_name & is_one_instr i ->
++ when s = !function_name && is_one_instr i ->
+ emit_instr i.next (Some i);
+ emit_all i.next.next
+ | {next = {desc = Lop(Icall_ind)}}
+- when is_one_instr i & no_interference i.res i.next.arg ->
++ when is_one_instr i && no_interference i.res i.next.arg ->
+ emit_instr i.next (Some i);
+ emit_all i.next.next
+ | {next = {desc = Lcondbranch(_, _)}}
+- when is_one_instr i & no_interference i.res i.next.arg ->
++ when is_one_instr i && no_interference i.res i.next.arg ->
+ emit_instr i.next (Some i);
+ emit_all i.next.next
+ | _ ->
+--
diff --git a/debian/patches/series b/debian/patches/series
index a47d64c..3c070d2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -9,3 +9,4 @@
0009-Fix-typos-and-other-wording-issues.patch
0010-Add-const-qualifiers-in-Tcl-Tk-bindings.patch
0011-Enable-mkstemp-in-yacc.patch
+0012-Fix-ocamlopt-on-sparc.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ocaml-maint/packages/ocaml.git
More information about the Pkg-ocaml-maint-commits
mailing list