summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfabbing <fabrice@tarides.com>2022-03-08 10:43:06 +0100
committerfabbing <fabrice@tarides.com>2022-06-30 13:35:53 +0200
commitbc73ca830379e389c3b0e892c530be02ff009ea1 (patch)
tree57ef9549d8bc6125f20e49ac1c9fb2e33869fafe
parentc8ba671cc39b14c1315107cb574d7d12eee2343c (diff)
downloadocaml-bc73ca830379e389c3b0e892c530be02ff009ea1.tar.gz
Update Iextcall of emit_instr for frame-pointers
-rw-r--r--asmcomp/amd64/emit.mlp6
-rw-r--r--asmcomp/amd64/proc.ml3
-rw-r--r--asmcomp/x86_dsl.ml1
-rw-r--r--asmcomp/x86_dsl.mli1
4 files changed, 7 insertions, 4 deletions
diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp
index 8c8c8492a2..4e986c25e4 100644
--- a/asmcomp/amd64/emit.mlp
+++ b/asmcomp/amd64/emit.mlp
@@ -553,16 +553,16 @@ let emit_instr env fallthrough i =
emit_call "caml_c_call";
record_frame env i.live (Dbg_other i.dbg);
end else begin
- I.mov rsp rbp;
+ I.mov rsp rbx;
cfi_remember_state ();
- cfi_def_cfa_register "rbp";
+ cfi_def_cfa_register "rbx";
(* NB: gdb has asserts on contiguous stacks that mean it
will not unwind through this unless we were to tag this
calling frame with cfi_signal_frame in it's definition. *)
I.mov (domain_field Domainstate.Domain_c_stack) rsp;
emit_call func;
- I.mov rbp rsp;
+ I.mov rbx rsp;
cfi_restore_state ();
end
| Lop(Istackoffset n) ->
diff --git a/asmcomp/amd64/proc.ml b/asmcomp/amd64/proc.ml
index 64b05a95c8..0baab0e634 100644
--- a/asmcomp/amd64/proc.ml
+++ b/asmcomp/amd64/proc.ml
@@ -301,8 +301,9 @@ let destroyed_at_c_call =
100;101;102;103;104;105])
else
(* Unix: rbx, r12-r15 preserved *)
+ (* FIXME fabbing using rbx in replacement of rbp *)
Array.of_list(List.map phys_reg
- [0;2;3;4;5;6;7;10;11;12;
+ [0;1;2;3;4;5;6;7;10;11;
100;101;102;103;104;105;106;107;
108;109;110;111;112;113;114;115])
diff --git a/asmcomp/x86_dsl.ml b/asmcomp/x86_dsl.ml
index 18fecddf24..1a1dba4232 100644
--- a/asmcomp/x86_dsl.ml
+++ b/asmcomp/x86_dsl.ml
@@ -48,6 +48,7 @@ let ah = Reg8H AH
let cl = Reg8L RCX
let ax = Reg16 RAX
let rax = Reg64 RAX
+let rbx = Reg64 RBX
let rdx = Reg64 RDX
let r10 = Reg64 R10
let r11 = Reg64 R11
diff --git a/asmcomp/x86_dsl.mli b/asmcomp/x86_dsl.mli
index c587e8fac1..9827836f82 100644
--- a/asmcomp/x86_dsl.mli
+++ b/asmcomp/x86_dsl.mli
@@ -37,6 +37,7 @@ val ah: arg
val cl: arg
val ax: arg
val rax: arg
+val rbx: arg
val rdx: arg
val r10: arg
val r11: arg