Skip to Main content Skip to Navigation
Theses

Formally verified compilation of low-level C code

Abstract : This thesis presents an extension of the CompCert compiler that aims at providing formal guarantees about the compilation of more programs than CompCert does. The CompCert compiler compiles C code into assembly code for various architectures and provides formal guarantees about the behaviour of the compiled assembly program. It states that whenever the C program has a defined semantics, the generated assembly program behaves similarly. However, the theorem does not provide any guarantee when the source program has undefined semantics, or, in C parlance, when it exhibits undefined behaviour, even though those behaviours actually happen in real-world code. This thesis exhibits a number of C idioms, that occur in real-life code and whose behaviour is undefined according to the C standard. Because they happen in real programs, our goal is to enhance the CompCert verified compiler so that it also provides formal guarantees for those programs. To that end, we propose a memory model for CompCert that makes pointer arithmetic and uninitialised data manipulation defined, introducing a notion of symbolic values that capture the meaning of otherwise undefined idioms. We adapt the whole memory model of CompCert with this new formalism and adapt the semantics of all the intermediate languages. We prove that our enhanced semantics subsumes that of CompCert. Moreover, we show that these symbolic semantics capture the behaviour of the previously undefined C idioms. The proof of semantic preservation from CompCert needs to be reworked to cope with our model. We therefore generalize important proof techniques such as memory injections, which enable us to port the whole proof of CompCert to our new memory model, therefore providing formal guarantees for more programs.
Document type :
Theses
Complete list of metadata

Cited literature [51 references]  Display  Hide  Download

https://tel.archives-ouvertes.fr/tel-01483676
Contributor : Abes Star :  Contact
Submitted on : Monday, March 6, 2017 - 11:55:17 AM
Last modification on : Tuesday, March 16, 2021 - 3:08:21 AM
Long-term archiving on: : Wednesday, June 7, 2017 - 1:16:23 PM

File

WILKE_Pierre.pdf
Version validated by the jury (STAR)

Identifiers

  • HAL Id : tel-01483676, version 1

Citation

Pierre Wilke. Formally verified compilation of low-level C code. Programming Languages [cs.PL]. Université Rennes 1, 2016. English. ⟨NNT : 2016REN1S088⟩. ⟨tel-01483676⟩

Share

Metrics

Record views

586

Files downloads

747