diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2014-08-17 07:52:12 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2014-08-17 07:52:12 +0000 |
commit | 17f519651feb4a09aa90c89c949469e8a5ab0e88 (patch) | |
tree | c7bda5e43a2d1f950180521a1b854ac9592eea73 /cfrontend/Cexec.v | |
parent | 88613c0f5415a0d3f2e0e0e9ff74bd32b6b4685e (diff) | |
download | compcert-17f519651feb4a09aa90c89c949469e8a5ab0e88.tar.gz compcert-17f519651feb4a09aa90c89c949469e8a5ab0e88.zip |
- 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/Cexec.v')
-rw-r--r-- | cfrontend/Cexec.v | 8 |
1 files changed, 3 insertions, 5 deletions
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... |