aboutsummaryrefslogtreecommitdiffstats
path: root/backend/Unusedglobproof.v
diff options
context:
space:
mode:
Diffstat (limited to 'backend/Unusedglobproof.v')
-rw-r--r--backend/Unusedglobproof.v88
1 files changed, 45 insertions, 43 deletions
diff --git a/backend/Unusedglobproof.v b/backend/Unusedglobproof.v
index 476208b0..ce9c7a86 100644
--- a/backend/Unusedglobproof.v
+++ b/backend/Unusedglobproof.v
@@ -910,50 +910,52 @@ Proof.
econstructor; eauto. apply set_reg_inject; auto.
- (* load *)
- assert (A: exists ta,
- eval_addressing tge (Vptr tsp Ptrofs.zero) addr trs##args = Some ta
- /\ Val.inject j a ta).
- { apply eval_addressing_inj with (ge1 := ge) (sp1 := Vptr sp0 Ptrofs.zero) (vl1 := rs##args).
- intros. apply symbol_address_inject. eapply match_stacks_preserves_globals; eauto.
- apply KEPT. red. exists pc, (Iload trap chunk addr args dst pc'); auto.
- econstructor; eauto.
- apply regs_inject; auto.
- assumption. }
- destruct A as (ta & B & C).
- exploit Mem.loadv_inject; eauto. intros (tv & D & E).
- econstructor; split. eapply exec_Iload; eauto.
- econstructor; eauto. apply set_reg_inject; auto.
-
-- (* load notrap1 *)
- assert (eval_addressing tge (Vptr tsp Ptrofs.zero) addr trs##args = None).
- { eapply eval_addressing_inj_none.
- intros. apply symbol_address_inject. eapply match_stacks_preserves_globals; eauto.
- apply KEPT. red. exists pc, (Iload NOTRAP chunk addr args dst pc'); auto.
- econstructor; eauto.
- rewrite Ptrofs.add_zero; reflexivity.
- apply regs_inject; auto.
- eassumption.
- assumption. }
-
- econstructor; split. eapply exec_Iload_notrap1; eauto.
- econstructor; eauto. apply set_reg_inject; auto.
-
-- (* load notrap2 *)
- assert (A: exists ta,
- eval_addressing tge (Vptr tsp Ptrofs.zero) addr trs##args = Some ta
- /\ Val.inject j a ta).
- { apply eval_addressing_inj with (ge1 := ge) (sp1 := Vptr sp0 Ptrofs.zero) (vl1 := rs##args).
- intros. apply symbol_address_inject. eapply match_stacks_preserves_globals; eauto.
- apply KEPT. red. exists pc, (Iload NOTRAP chunk addr args dst pc'); auto.
- econstructor; eauto.
- apply regs_inject; auto.
- assumption. }
- destruct A as (ta & B & C).
- destruct (Mem.loadv chunk tm ta) eqn:Echunk2.
- + econstructor; split. eapply exec_Iload; eauto.
- econstructor; eauto. apply set_reg_inject; auto.
- + econstructor; split. eapply exec_Iload_notrap2; eauto.
+ inv H0.
+ + assert (A: exists ta,
+ eval_addressing tge (Vptr tsp Ptrofs.zero) addr trs##args = Some ta
+ /\ Val.inject j a ta).
+ { apply eval_addressing_inj with (ge1 := ge) (sp1 := Vptr sp0 Ptrofs.zero) (vl1 := rs##args).
+ intros. apply symbol_address_inject. eapply match_stacks_preserves_globals; eauto.
+ apply KEPT. red. exists pc, (Iload trap chunk addr args dst pc'); auto.
+ econstructor; eauto.
+ apply regs_inject; auto.
+ assumption. }
+ destruct A as (ta & B & C).
+ exploit Mem.loadv_inject; eauto. intros (tv & D & E).
+ econstructor; split. eapply exec_Iload; eauto. eapply has_loaded_normal; eauto.
econstructor; eauto. apply set_reg_inject; auto.
+ + destruct (eval_addressing) eqn:EVAL in LOAD.
+ * specialize (LOAD v).
+ assert (A: exists ta,
+ eval_addressing tge (Vptr tsp Ptrofs.zero) addr trs##args = Some ta
+ /\ Val.inject j v ta).
+ { apply eval_addressing_inj with (ge1 := ge) (sp1 := Vptr sp0 Ptrofs.zero) (vl1 := rs##args).
+ intros. apply symbol_address_inject. eapply match_stacks_preserves_globals; eauto.
+ apply KEPT. red. exists pc, (Iload NOTRAP chunk addr args dst pc'); auto.
+ econstructor; eauto.
+ apply regs_inject; auto.
+ assumption. }
+ destruct A as (ta & B & C).
+ destruct (Mem.loadv chunk tm ta) eqn:Echunk2.
+ ** econstructor; split. eapply exec_Iload; eauto. eapply has_loaded_normal; eauto.
+ econstructor; eauto. apply set_reg_inject; auto.
+ ** econstructor; split. eapply exec_Iload; eauto. eapply has_loaded_default; eauto.
+ intros a EVAL'; rewrite B in EVAL'; inv EVAL'. auto.
+ econstructor; eauto. apply set_reg_inject; auto.
+ * assert (eval_addressing tge (Vptr tsp Ptrofs.zero) addr trs##args = None).
+ { eapply eval_addressing_inj_none.
+ intros. apply symbol_address_inject. eapply match_stacks_preserves_globals; eauto.
+ apply KEPT. red. exists pc, (Iload NOTRAP chunk addr args dst pc'); auto.
+ econstructor; eauto.
+ rewrite Ptrofs.add_zero; reflexivity.
+ apply regs_inject; auto.
+ eassumption.
+ assumption. }
+
+ econstructor; split. eapply exec_Iload; eauto. eapply has_loaded_default; eauto.
+ intros a EVAL'; rewrite H0 in EVAL'; inv EVAL'.
+ econstructor; eauto. apply set_reg_inject; auto.
+
- (* store *)
assert (A: exists ta,
eval_addressing tge (Vptr tsp Ptrofs.zero) addr trs##args = Some ta