Compositional compcert
Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of …, 2015•dl.acm.org
This paper reports on the development of Compositional CompCert, the first verified
separate compiler for C. Specifying and proving separate compilation for C is made
challenging by the coincidence of: compiler optimizations, such as register spilling, that
introduce compiler-managed (private) memory regions into function stack frames, and C's
stack-allocated addressable local variables, which may leak portions of stack frames to other
modules when their addresses are passed as arguments to external function calls. The …
separate compiler for C. Specifying and proving separate compilation for C is made
challenging by the coincidence of: compiler optimizations, such as register spilling, that
introduce compiler-managed (private) memory regions into function stack frames, and C's
stack-allocated addressable local variables, which may leak portions of stack frames to other
modules when their addresses are passed as arguments to external function calls. The …
This paper reports on the development of Compositional CompCert, the first verified separate compiler for C.
Specifying and proving separate compilation for C is made challenging by the coincidence of: compiler optimizations, such as register spilling, that introduce compiler-managed (private) memory regions into function stack frames, and C's stack-allocated addressable local variables, which may leak portions of stack frames to other modules when their addresses are passed as arguments to external function calls. The CompCert compiler, as built/proved by Leroy etal 2006--2014, has proofs of correctness for whole programs, but its simulation relations are too weak to specify or prove separately compiled modules.
Our technical contributions that make Compositional CompCert possible include: language-independent linking, a new operational model of multilanguage linking that supports strong semantic contextual equivalences; and structured simulations, a refinement of Beringer etal logical simulation relations that enables expressive module-local invariants on the state communicated between compilation units at runtime. All the results in the paper have been formalized in Coq and are available for download together with the Compositional CompCert compiler.
ACM Digital Library