Skip to content

Commit

Permalink
Fix destroyed_at_c_call on RISC-V (ocaml#10349)
Browse files Browse the repository at this point in the history
* caml_c_call clobbers s2
* Changes

(cherry picked from commit 93a9b2d)
  • Loading branch information
mshinwell authored and edwintorok committed Jun 26, 2021
1 parent b92ecd3 commit 2c90e8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ OCaml 4.12, maintenance version
platforms without AFL support.
(David Allsopp, review by Xavier Leroy)

- #10349: Fix destroyed_at_c_call on RISC-V
(Mark Shinwell, review by Nicolás Ojeda Bär)

- #10294, #10295: fix an assert-failure in pattern-matching compilation
(Gabriel Scherer, review by Thomas Refis and Luc Maranget,
report by Nicolás Ojeda Bär)
Expand Down
5 changes: 3 additions & 2 deletions asmcomp/riscv/proc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,10 @@ let regs_are_volatile _ = false
(* Registers destroyed by operations *)

let destroyed_at_c_call =
(* s0-s11 and fs0-fs11 are callee-save *)
(* s0-s11 and fs0-fs11 are callee-save. However s2 needs to be in this
list since it is clobbered by caml_c_call itself. *)
Array.of_list(List.map phys_reg
[0; 1; 2; 3; 4; 5; 6; 7; 16; 17; 18; 19; 20; 22;
[0; 1; 2; 3; 4; 5; 6; 7; 8; 16; 17; 18; 19; 20; 22;
100; 101; 102; 103; 104; 105; 106; 107; 110; 111; 112; 113; 114; 115; 116;
117; 128; 129; 130; 131])

Expand Down

0 comments on commit 2c90e8f

Please sign in to comment.