aboutsummaryrefslogtreecommitdiffstats
path: root/cfrontend/ClightBigstep.v
diff options
context:
space:
mode:
authorxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2014-08-17 07:52:12 +0000
committerxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2014-08-17 07:52:12 +0000
commit17f519651feb4a09aa90c89c949469e8a5ab0e88 (patch)
treec7bda5e43a2d1f950180521a1b854ac9592eea73 /cfrontend/ClightBigstep.v
parent88613c0f5415a0d3f2e0e0e9ff74bd32b6b4685e (diff)
downloadcompcert-kvx-17f519651feb4a09aa90c89c949469e8a5ab0e88.tar.gz
compcert-kvx-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/ClightBigstep.v')
-rw-r--r--cfrontend/ClightBigstep.v12
1 files changed, 7 insertions, 5 deletions
diff --git a/cfrontend/ClightBigstep.v b/cfrontend/ClightBigstep.v
index f7a0e189..d61e4eef 100644
--- a/cfrontend/ClightBigstep.v
+++ b/cfrontend/ClightBigstep.v
@@ -151,8 +151,9 @@ Inductive exec_stmt: env -> temp_env -> mem -> statement -> trace -> temp_env ->
exec_stmt e le2 m2 (Sloop s1 s2) t3 le3 m3 out ->
exec_stmt e le m (Sloop s1 s2)
(t1**t2**t3) le3 m3 out
- | exec_Sswitch: forall e le m a t n sl le1 m1 out,
- eval_expr ge e le m a (Vint n) ->
+ | exec_Sswitch: forall e le m a t v n sl le1 m1 out,
+ eval_expr ge e le m a v ->
+ sem_switch_arg v (typeof a) = Some n ->
exec_stmt e le m (seq_of_labeled_statement (select_switch n sl)) t le1 m1 out ->
exec_stmt e le m (Sswitch a sl)
t le1 m1 (outcome_switch out)
@@ -220,8 +221,9 @@ CoInductive execinf_stmt: env -> temp_env -> mem -> statement -> traceinf -> Pro
exec_stmt e le1 m1 s2 t2 le2 m2 Out_normal ->
execinf_stmt e le2 m2 (Sloop s1 s2) t3 ->
execinf_stmt e le m (Sloop s1 s2) (t1***t2***t3)
- | execinf_Sswitch: forall e le m a t n sl,
- eval_expr ge e le m a (Vint n) ->
+ | execinf_Sswitch: forall e le m a t v n sl,
+ eval_expr ge e le m a v ->
+ sem_switch_arg v (typeof a) = Some n ->
execinf_stmt e le m (seq_of_labeled_statement (select_switch n sl)) t ->
execinf_stmt e le m (Sswitch a sl) t
@@ -427,7 +429,7 @@ Proof.
auto.
(* switch *)
- destruct (H1 f (Kswitch k)) as [S1 [A1 B1]].
+ destruct (H2 f (Kswitch k)) as [S1 [A1 B1]].
set (S2 :=
match out with
| Out_normal => State f Sskip k e le1 m1