diff options
Diffstat (limited to 'arm')
-rw-r--r-- | arm/Asm.v | 11 | ||||
-rw-r--r-- | arm/Asmgenproof.v | 4 |
2 files changed, 12 insertions, 3 deletions
@@ -852,6 +852,15 @@ Definition preg_of (r: mreg) : preg := | F12 => FR12 | F13 => FR13 | F14 => FR14 | F15 => FR15 end. +(** Undefine all registers except SP and callee-save registers *) + +Definition undef_caller_save_regs (rs: regset) : regset := + fun r => + if preg_eq r SP + || In_dec preg_eq r (List.map preg_of (List.filter is_callee_save all_mregs)) + then rs r + else Vundef. + (** Extract the values of the arguments of an external call. We exploit the calling conventions from module [Conventions], except that we use ARM registers instead of locations. *) @@ -911,7 +920,7 @@ Inductive step: state -> trace -> state -> Prop := Genv.find_funct_ptr ge b = Some (External ef) -> external_call ef ge args m t res m' -> extcall_arguments rs m (ef_sig ef) args -> - rs' = (set_pair (loc_external_result (ef_sig ef) ) res rs)#PC <- (rs IR14) -> + rs' = (set_pair (loc_external_result (ef_sig ef) ) res (undef_caller_save_regs rs))#PC <- (rs IR14) -> step (State rs m) t (State rs' m'). End RELSEM. diff --git a/arm/Asmgenproof.v b/arm/Asmgenproof.v index abec6815..2c001f45 100644 --- a/arm/Asmgenproof.v +++ b/arm/Asmgenproof.v @@ -926,8 +926,8 @@ Opaque loadind. apply plus_one. eapply exec_step_external; eauto. eapply external_call_symbols_preserved; eauto. apply senv_preserved. econstructor; eauto. - apply agree_set_other; auto with asmgen. - eapply agree_set_pair; eauto. + unfold loc_external_result. apply agree_set_other; auto. apply agree_set_pair; auto. + apply agree_undef_caller_save_regs; auto. - (* return *) inv STACKS. simpl in *. |