From 17f519651feb4a09aa90c89c949469e8a5ab0e88 Mon Sep 17 00:00:00 2001 From: xleroy Date: Sun, 17 Aug 2014 07:52:12 +0000 Subject: - 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 --- cfrontend/SimplLocalsproof.v | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'cfrontend/SimplLocalsproof.v') 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. -- cgit v1.2.3