aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2009-03-26 09:50:18 +0000
committerxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2009-03-26 09:50:18 +0000
commit00b605a1d52696b055dd232a05dd54a312680b93 (patch)
tree7ebbd57e1d7c60e8b52e07526617c1aa30f3740f /common
parentc90abe06d110eb9c39b941792d896c741dc851dd (diff)
downloadcompcert-kvx-00b605a1d52696b055dd232a05dd54a312680b93.tar.gz
compcert-kvx-00b605a1d52696b055dd232a05dd54a312680b93.zip
Added tail call optimization pass
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1015 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'common')
-rw-r--r--common/AST.v6
-rw-r--r--common/Mem.v20
2 files changed, 26 insertions, 0 deletions
diff --git a/common/AST.v b/common/AST.v
index eab1adf1..ec8053d4 100644
--- a/common/AST.v
+++ b/common/AST.v
@@ -46,6 +46,12 @@ Definition typesize (ty: typ) : Z :=
Lemma typesize_pos: forall ty, typesize ty > 0.
Proof. destruct ty; simpl; omega. Qed.
+Lemma typ_eq: forall (t1 t2: typ), {t1=t2} + {t1<>t2}.
+Proof. decide equality. Qed.
+
+Lemma opt_typ_eq: forall (t1 t2: option typ), {t1=t2} + {t1<>t2}.
+Proof. decide equality. apply typ_eq. Qed.
+
(** Additionally, function definitions and function calls are annotated
by function signatures indicating the number and types of arguments,
as well as the type of the returned value if any. These signatures
diff --git a/common/Mem.v b/common/Mem.v
index de3e8c94..e169dfc7 100644
--- a/common/Mem.v
+++ b/common/Mem.v
@@ -1796,6 +1796,26 @@ Proof.
unfold inject_id; intros. congruence.
Qed.
+Lemma free_left_lessdef:
+ forall m1 m2 b,
+ lessdef m1 m2 -> lessdef (free m1 b) m2.
+Proof.
+ intros. destruct H. split.
+ rewrite <- H. auto.
+ apply free_left_inj; auto.
+Qed.
+
+Lemma free_right_lessdef:
+ forall m1 m2 b,
+ lessdef m1 m2 -> low_bound m1 b >= high_bound m1 b ->
+ lessdef m1 (free m2 b).
+Proof.
+ intros. destruct H. unfold lessdef. split.
+ rewrite H. auto.
+ apply free_right_inj; auto. intros. unfold inject_id in H2. inv H2.
+ red; intro. inv H2. generalize (size_chunk_pos chunk); intro. omega.
+Qed.
+
Lemma valid_block_lessdef:
forall m1 m2 b, lessdef m1 m2 -> valid_block m1 b -> valid_block m2 b.
Proof.