diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2014-11-05 14:36:14 +0100 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2014-11-24 17:50:52 +0100 |
commit | 10941819e09e2f9090e7fe39301a0b9026a0eba0 (patch) | |
tree | c773e41153eb302cc5865de8f08e8503a7449057 /driver | |
parent | ad8c37d0ebb36cb2e54baeacf5a4c7ff145b1a99 (diff) | |
download | compcert-10941819e09e2f9090e7fe39301a0b9026a0eba0.tar.gz compcert-10941819e09e2f9090e7fe39301a0b9026a0eba0.zip |
Verification of the Unusedglob pass (removal of unreferenced static global definitions). Assorted changes to ia32/Op.v. PowerPC and ARM need updating.
Diffstat (limited to 'driver')
-rw-r--r-- | driver/Compiler.v | 9 | ||||
-rw-r--r-- | driver/Driver.ml | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/driver/Compiler.v b/driver/Compiler.v index fb813c7c..0afa7bfb 100644 --- a/driver/Compiler.v +++ b/driver/Compiler.v @@ -46,6 +46,7 @@ Require Renumber. Require Constprop. Require CSE. Require Deadcode. +Require Unusedglob. Require Allocation. Require Tunneling. Require Linearize. @@ -65,6 +66,7 @@ Require Renumberproof. Require Constpropproof. Require CSEproof. Require Deadcodeproof. +Require Unusedglobproof. Require Allocproof. Require Tunnelingproof. Require Linearizeproof. @@ -135,6 +137,8 @@ Definition transf_rtl_program (f: RTL.program) : res Asm.program := @@ print (print_RTL 6) @@@ partial_if Compopts.optim_redundancy (time "Redundancy elimination" Deadcode.transf_program) @@ print (print_RTL 7) + @@@ time "Unused globals" Unusedglob.transform_program + @@ print (print_RTL 8) @@@ time "Register allocation" Allocation.transf_program @@ print print_LTL @@ time "Branch tunneling" Tunneling.tunnel_program @@ -244,7 +248,8 @@ Proof. set (p21 := total_if optim_constprop Renumber.transf_program p2) in *. destruct (partial_if optim_CSE CSE.transf_program p21) as [p3|] eqn:?; simpl in H; try discriminate. destruct (partial_if optim_redundancy Deadcode.transf_program p3) as [p31|] eqn:?; simpl in H; try discriminate. - destruct (Allocation.transf_program p31) as [p4|] eqn:?; simpl in H; try discriminate. + destruct (Unusedglob.transform_program p31) as [p32|] eqn:?; simpl in H; try discriminate. + destruct (Allocation.transf_program p32) as [p4|] eqn:?; simpl in H; try discriminate. set (p5 := Tunneling.tunnel_program p4) in *. destruct (Linearize.transf_program p5) as [p6|] eqn:?; simpl in H; try discriminate. set (p7 := CleanupLabels.transf_program p6) in *. @@ -263,6 +268,8 @@ Proof. eapply partial_if_simulation; eauto. apply CSEproof.transf_program_correct. apply compose_forward_simulation with (RTL.semantics p31). eapply partial_if_simulation; eauto. apply Deadcodeproof.transf_program_correct. + apply compose_forward_simulation with (RTL.semantics p32). + apply Unusedglobproof.transf_program_correct; auto. apply compose_forward_simulation with (LTL.semantics p4). apply Allocproof.transf_program_correct; auto. apply compose_forward_simulation with (LTL.semantics p5). diff --git a/driver/Driver.ml b/driver/Driver.ml index 76509f41..fec87420 100644 --- a/driver/Driver.ml +++ b/driver/Driver.ml @@ -150,7 +150,7 @@ let compile_c_ast sourcename csyntax ofile = let asm = match Compiler.transf_c_program csyntax with | Errors.OK asm -> - Asmexpand.expand_program (Unusedglob.transf_program asm) + Asmexpand.expand_program asm | Errors.Error msg -> print_error stderr msg; exit 2 in |