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/Cexec.v | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'cfrontend/Cexec.v') diff --git a/cfrontend/Cexec.v b/cfrontend/Cexec.v index eea1997e..0e070934 100644 --- a/cfrontend/Cexec.v +++ b/cfrontend/Cexec.v @@ -1980,10 +1980,8 @@ Definition do_step (w: world) (s: state) : list (trace * state) := do m' <- Mem.free_list m (blocks_of_env e); ret (Returnstate v' (call_cont k) m') | Kswitch1 sl k => - match v with - | Vint n => ret (State f (seq_of_labeled_statement (select_switch n sl)) (Kswitch2 k) e m) - | _ => nil - end + do n <- sem_switch_arg v ty; + ret (State f (seq_of_labeled_statement (select_switch n sl)) (Kswitch2 k) e m) | _ => nil end @@ -2089,7 +2087,6 @@ Proof with try (left; right; econstructor; eauto; fail). (* expression is a value *) rewrite (is_val_inv _ _ _ Heqo). destruct k; myinv... - destruct v; myinv... (* expression reduces *) intros. exploit list_in_map_inv; eauto. intros [[C rd] [A B]]. generalize (step_expr_sound e w r RV m). unfold reducts_ok. intros [P Q]. @@ -2189,6 +2186,7 @@ Proof with (unfold ret; auto with coqlib). rewrite H0... rewrite H0; rewrite H1... rewrite H1. red in H0. destruct k; try contradiction... + rewrite H0... destruct H0; subst x... rewrite H0... -- cgit