Common compiler optimisations are invalid in the C11 memory model and what we can do about it - Inria - Institut national de recherche en sciences et technologies du numérique Access content directly
Conference Papers Year : 2015

Common compiler optimisations are invalid in the C11 memory model and what we can do about it

Abstract

We show that the weak memory model introduced by the 2011 C and C++ standards does not permit many common source-to-source program transformations (such as expression linearisation and “roach motel” reorderings) that modern compilers perform and that are deemed to be correct. As such it cannot be used to define the semantics of intermediate languages of compilers, as, for instance, LLVM aimed to. We consider a number of possible local fixes, some strengthening and some weakening the model. We evaluate the proposed fixes by determining which program transformations are valid with respect to each of the patched models. We provide formal Coq proofs of their correctness or counterexamples as appropriate.
No file

Dates and versions

hal-01089047 , version 1 (01-12-2014)

Identifiers

  • HAL Id : hal-01089047 , version 1

Cite

Viktor Vafeiadis, Thibaut Balabonski, Soham Chakraborty, Robin Morisset, Francesco Zappa Nardelli. Common compiler optimisations are invalid in the C11 memory model and what we can do about it. POPL 2015 - 42nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Jan 2015, Mumbai, India. ⟨hal-01089047⟩
190 View
0 Download

Share

Gmail Mastodon Facebook X LinkedIn More