diff options
author | Léo Gourdin <leo.gourdin@lilo.org> | 2021-11-02 16:25:58 +0100 |
---|---|---|
committer | Léo Gourdin <leo.gourdin@lilo.org> | 2021-11-02 16:25:58 +0100 |
commit | 17b1ec4333af8120ab6867baf9c5c9139541c6b7 (patch) | |
tree | 71bd521b6603820c81217ebc10a24fcd940f110a /backend/Unusedglobproof.v | |
parent | e9dc339d5e5ec129dcf6b541d6c70f9ca7fe134c (diff) | |
parent | 98ec44d9d96e7e94896eea9ac054a0188be7b6dd (diff) | |
download | compcert-kvx-17b1ec4333af8120ab6867baf9c5c9139541c6b7.tar.gz compcert-kvx-17b1ec4333af8120ab6867baf9c5c9139541c6b7.zip |
Merge branch 'RTL_has_loaded' into kvx-work
Diffstat (limited to 'backend/Unusedglobproof.v')
-rw-r--r-- | backend/Unusedglobproof.v | 88 |
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 |