summaryrefslogtreecommitdiff
path: root/cfrontend/SimplLocalsproof.v
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2014-08-17 07:52:12 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2014-08-17 07:52:12 +0000
commit17f519651feb4a09aa90c89c949469e8a5ab0e88 (patch)
treec7bda5e43a2d1f950180521a1b854ac9592eea73 /cfrontend/SimplLocalsproof.v
parent88613c0f5415a0d3f2e0e0e9ff74bd32b6b4685e (diff)
- Support "switch" statements over 64-bit integers
(in CompCert C to Cminor, included) - Translation of "switch" to decision trees or jumptables made generic over the sizes of integers and moved to the Cminor->CminorSel pass instead of CminorSel->RTL as before. - CminorSel: add "exitexpr" to support the above. - ValueDomain: more precise analysis of comparisons against an integer literal. E.g. "x >=u 0" is always true. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2565 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cfrontend/SimplLocalsproof.v')
-rw-r--r--cfrontend/SimplLocalsproof.v10
1 files changed, 7 insertions, 3 deletions
diff --git a/cfrontend/SimplLocalsproof.v b/cfrontend/SimplLocalsproof.v
index 6024de4..67a7e62 100644
--- a/cfrontend/SimplLocalsproof.v
+++ b/cfrontend/SimplLocalsproof.v
@@ -1798,7 +1798,7 @@ Proof.
induction ls; simpl; intros; monadInv H; simpl.
auto.
destruct o.
- destruct (Int.eq i n).
+ destruct (zeq z n).
econstructor; split; eauto. simpl; rewrite EQ, EQ1; auto.
apply IHls. auto.
apply IHls. auto.
@@ -1840,7 +1840,7 @@ Proof.
{
induction ls; simpl; intros.
discriminate.
- destruct o. destruct (Int.eq i n). inv H0. auto. eauto with compat.
+ destruct o. destruct (zeq z n). inv H0. auto. eauto with compat.
eauto with compat.
}
intros. specialize (CASE ls). unfold select_switch.
@@ -2104,8 +2104,12 @@ Proof.
intros. apply match_cont_change_cenv with (cenv_for f); auto. eapply match_cont_free_env; eauto.
(* switch *)
- exploit eval_simpl_expr; eauto with compat. intros [tv [A B]]. inv B.
+ exploit eval_simpl_expr; eauto with compat. intros [tv [A B]].
econstructor; split. apply plus_one. econstructor; eauto.
+ rewrite typeof_simpl_expr. instantiate (1 := n).
+ unfold sem_switch_arg in *;
+ destruct (classify_switch (typeof a)); try discriminate;
+ inv B; inv H0; auto.
econstructor; eauto.
erewrite simpl_seq_of_labeled_statement. reflexivity.
eapply simpl_select_switch; eauto.