Service interruption on Monday 11 July from 12:30 to 13:00: all the sites of the CCSD (HAL, EpiSciences, SciencesConf, AureHAL) will be inaccessible (network hardware connection).
Skip to Main content Skip to Navigation

Formally verified compilation of low-level C code

Pierre Wilke 1, 2 
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 :
Complete list of metadata

Cited literature [51 references]  Display  Hide  Download
Contributor : ABES STAR :  Contact
Submitted on : Monday, March 6, 2017 - 11:55:17 AM
Last modification on : Saturday, June 25, 2022 - 7:39:59 PM
Long-term archiving on: : Wednesday, June 7, 2017 - 1:16:23 PM


Version validated by the jury (STAR)


  • HAL Id : tel-01483676, version 1


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



Record views


Files downloads