diff options
author | Cyril SIX <cyril.six@kalray.eu> | 2019-09-03 10:52:23 +0200 |
---|---|---|
committer | Cyril SIX <cyril.six@kalray.eu> | 2019-09-03 10:52:23 +0200 |
commit | 0cb5a0b65b4fbeb5bc1c14f75951798f20500177 (patch) | |
tree | 767381d2490c86dcee95da2631ac5c94e14de8f5 /cfrontend/Cop.v | |
parent | 1fbd5d18a9f4398d7ecb9b9ab148a96f575fd1e0 (diff) | |
parent | 2f7f68f69b6408e4de6210c827b108eff011af51 (diff) | |
download | compcert-kvx-0cb5a0b65b4fbeb5bc1c14f75951798f20500177.tar.gz compcert-kvx-0cb5a0b65b4fbeb5bc1c14f75951798f20500177.zip |
Merge remote-tracking branch 'origin/mppa-work-upstream-merge' into mppa-work
Conflicts:
configure
mppa_k1c/Archi.v
mppa_k1c/Asmexpand.ml
Diffstat (limited to 'cfrontend/Cop.v')
-rw-r--r-- | cfrontend/Cop.v | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/cfrontend/Cop.v b/cfrontend/Cop.v index c395a2cb..aa73abb0 100644 --- a/cfrontend/Cop.v +++ b/cfrontend/Cop.v @@ -1131,7 +1131,7 @@ Qed. Remark val_inject_vptrofs: forall n, Val.inject f (Vptrofs n) (Vptrofs n). Proof. intros. unfold Vptrofs. destruct Archi.ptr64; auto. Qed. -Hint Resolve val_inject_vtrue val_inject_vfalse val_inject_of_bool val_inject_vptrofs. +Local Hint Resolve val_inject_vtrue val_inject_vfalse val_inject_of_bool val_inject_vptrofs : core. Ltac TrivialInject := match goal with @@ -1517,7 +1517,7 @@ Inductive val_casted: val -> type -> Prop := | val_casted_void: forall v, val_casted v Tvoid. -Hint Constructors val_casted. +Local Hint Constructors val_casted : core. Remark cast_int_int_idem: forall sz sg i, cast_int_int sz sg (cast_int_int sz sg i) = cast_int_int sz sg i. @@ -1580,6 +1580,27 @@ Proof. intros. apply cast_val_casted. eapply cast_val_is_casted; eauto. Qed. +(** Moreover, casted values belong to the machine type corresponding to the + C type. *) + +Lemma val_casted_has_type: + forall v ty, val_casted v ty -> ty <> Tvoid -> Val.has_type v (typ_of_type ty). +Proof. + intros. inv H; simpl typ_of_type. +- exact I. +- exact I. +- exact I. +- exact I. +- apply Val.Vptr_has_type. +- red; unfold Tptr; rewrite H1; auto. +- red; unfold Tptr; rewrite H1; auto. +- red; unfold Tptr; rewrite H1; auto. +- red; unfold Tptr; rewrite H1; auto. +- apply Val.Vptr_has_type. +- apply Val.Vptr_has_type. +- congruence. +Qed. + (** Relation with the arithmetic conversions of ISO C99, section 6.3.1 *) Module ArithConv. |