summaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-12-30 16:37:05 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-12-30 16:37:05 +0000
commit51e8bc524d570439f868ec0bdbf718cb53ca7669 (patch)
tree5211b1971bdc1df4bc231dfef90cd15e3758a7e3 /backend
parent98089fdf4880b46a57aafa96ea00578e396bb58b (diff)
Ctypes.sizeof ty = 0 for empty types ty (zero-sized array, empty struct/union).
__builtin_memcpy_aligned now supports the case sz = 0. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2392 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'backend')
-rw-r--r--backend/CSEproof.v1
-rw-r--r--backend/ValueAnalysis.v3
-rw-r--r--backend/ValueDomain.v10
3 files changed, 4 insertions, 10 deletions
diff --git a/backend/CSEproof.v b/backend/CSEproof.v
index 6c9331a..317fb82 100644
--- a/backend/CSEproof.v
+++ b/backend/CSEproof.v
@@ -1135,7 +1135,6 @@ Proof.
inv SOUND. eapply add_memcpy_holds; eauto.
eapply kill_loads_after_storebytes_holds; eauto.
eapply Mem.loadbytes_length; eauto.
- omega.
simpl. apply Ple_refl.
+ apply CASE2; inv H0; auto.
+ apply CASE2; inv H0; auto.
diff --git a/backend/ValueAnalysis.v b/backend/ValueAnalysis.v
index 396d8d4..0709f5d 100644
--- a/backend/ValueAnalysis.v
+++ b/backend/ValueAnalysis.v
@@ -1271,9 +1271,6 @@ Proof.
eapply Mem.loadbytes_length; eauto.
intros. eapply loadbytes_sound; eauto. apply match_aptr_of_aval; auto.
eapply romatch_storebytes; eauto.
- exploit Mem.loadbytes_length; eauto.
- intros. exploit (nat_of_Z_eq sz). omega. rewrite <- H1; intros.
- destruct bytes. simpl in H2. omegaContradiction. congruence.
eapply sound_stack_storebytes; eauto.
+ (* annot *)
intros (A & B); subst.
diff --git a/backend/ValueDomain.v b/backend/ValueDomain.v
index 2c728d3..5d0e3ae 100644
--- a/backend/ValueDomain.v
+++ b/backend/ValueDomain.v
@@ -2727,16 +2727,14 @@ Qed.
Lemma romatch_storebytes:
forall m b ofs bytes m' rm,
Mem.storebytes m b ofs bytes = Some m' ->
- bytes <> nil ->
romatch m rm ->
romatch m' rm.
Proof.
- intros; red; intros. exploit H1; eauto. intros (A & B & C). split; auto. split.
+ intros; red; intros. exploit H0; eauto. intros (A & B & C). split; auto. split.
- apply bmatch_inv with m; auto.
- intros. eapply Mem.loadbytes_storebytes_other; eauto.
- left. red; intros; subst b0. elim (C ofs). apply Mem.perm_cur_max.
- eapply Mem.storebytes_range_perm; eauto.
- destruct bytes. congruence. simpl length. rewrite inj_S. omega.
+ intros. eapply Mem.loadbytes_storebytes_disjoint; eauto.
+ destruct (eq_block b0 b); auto. subst b0. right; red; unfold Intv.In; simpl; red; intros.
+ elim (C x). apply Mem.perm_cur_max. eapply Mem.storebytes_range_perm; eauto.
- intros; red; intros; elim (C ofs0). eauto with mem.
Qed.