From e575a86d45fd7fb7d53b82f5ed2ab38645468c1a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 15 Jul 2014 13:07:54 +0100 Subject: [PATCH] Disable CSE optimization which is broken on aarch64. --- 0001-Disable-CSE.patch | 38 ++++++++++++++++++++++++++++++++++++++ ocaml.spec | 11 ++++++++++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 0001-Disable-CSE.patch diff --git a/0001-Disable-CSE.patch b/0001-Disable-CSE.patch new file mode 100644 index 0000000..beb095f --- /dev/null +++ b/0001-Disable-CSE.patch @@ -0,0 +1,38 @@ +From 99cb8f909ad25bcfa674216f5140b6cf1e72aeca Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 15 Jul 2014 11:52:26 +0000 +Subject: [PATCH] Disable CSE. + +This disables the common subexpression elimination (CSE) optimization. + +This is broken on aarch64: +http://caml.inria.fr/mantis/view.php?id=6486 +--- + asmcomp/CSEgen.ml | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/asmcomp/CSEgen.ml b/asmcomp/CSEgen.ml +index 19019e1..260e4fa 100644 +--- a/asmcomp/CSEgen.ml ++++ b/asmcomp/CSEgen.ml +@@ -180,7 +180,8 @@ method private keep_checkbounds n = + (* Perform CSE on the given instruction [i] and its successors. + [n] is the value numbering current at the beginning of [i]. *) + +-method private cse n i = ++method private cse n i = i ++(* + match i.desc with + | Iend | Ireturn | Iop(Itailcall_ind) | Iop(Itailcall_imm _) + | Iexit _ | Iraise _ -> +@@ -262,6 +263,7 @@ method private cse n i = + {i with desc = Itrywith(self#cse n body, + self#cse empty_numbering handler); + next = self#cse empty_numbering i.next} ++*) + + method fundecl f = + {f with fun_body = self#cse empty_numbering f.fun_body} +-- +2.0.1 + diff --git a/ocaml.spec b/ocaml.spec index 16eda5b..50da5f5 100644 --- a/ocaml.spec +++ b/ocaml.spec @@ -20,7 +20,7 @@ Name: ocaml Version: 4.02.0 -Release: 0.1.git%{shortcommit}%{?dist} +Release: 0.2.git%{shortcommit}%{?dist} Summary: OCaml compiler and programming environment @@ -59,6 +59,12 @@ Patch0008: 0008-arm-arm64-Mark-stack-as-non-executable.patch Patch0009: 0009-arg-Add-no_arg-and-get_arg-helper-functions.patch Patch0010: 0010-arg-Allow-flags-such-as-flag-arg-as-well-as-flag-arg.patch +# On aarch64 only, the CSE optimization is broken. See: +# http://caml.inria.fr/mantis/view.php?id=6486 +%ifarch aarch64 +Patch9999: 0001-Disable-CSE.patch +%endif + # Add BFD support so that ocamlobjinfo supports *.cmxs format (RHBZ#1113735). BuildRequires: binutils-devel @@ -415,6 +421,9 @@ fi %changelog +* Tue Jul 15 2014 Richard W.M. Jones - 4.02.0-0.2 +- Disable CSE optimization which is broken on aarch64. + * Sat Jul 12 2014 Richard W.M. Jones - 4.02.0-0.1 - Update to 4.02.0-beta1 + patches from the upstream 4.02 branch. - REMOVED labltk and camlp4 packages, since these are now packaged