Skip to content

Commit

Permalink
[arm] Assume that Iextcall(_, true) destroys all physical registers.
Browse files Browse the repository at this point in the history
Fixed as suggested by Xavier Leroy, see note 6780 of PR#5433.
  • Loading branch information
bmeurer committed Jan 23, 2012
1 parent aff4473 commit 7658da0
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions asmcomp/arm/proc.ml
Expand Up @@ -175,7 +175,7 @@ let destroyed_at_alloc = (* r0-r7, d0-d15 preserved *)
116;116;118;119;120;121;122;123;
124;125;126;127;128;129;130;131])

let destroyed_at_extcall_noalloc =
let destroyed_at_c_call =
Array.of_list (List.map
phys_reg
(match abi with
Expand All @@ -191,18 +191,12 @@ let destroyed_at_extcall_noalloc =
116;116;118;119;120;121;122;123;
124;125;126;127;128;129;130;131]))

let destroyed_at_extcall = (* also destroys r4-r7 *)
Array.append
destroyed_at_extcall_noalloc
(Array.of_list(List.map phys_reg [4;5;6;7]))

let destroyed_at_oper = function
Iop(Icall_ind | Icall_imm _ ) ->
all_phys_regs
Iop(Icall_ind | Icall_imm _ )
| Iop(Iextcall(_, true)) ->
destroyed_at_extcall
all_phys_regs
| Iop(Iextcall(_, false)) ->
destroyed_at_extcall_noalloc
destroyed_at_c_call
| Iop(Ialloc n) ->
destroyed_at_alloc
| Iop(Iconst_symbol _) when !pic_code ->
Expand Down

0 comments on commit 7658da0

Please sign in to comment.