Skip to main navigation Skip to search Skip to main content

Common Compiler Optimisations are Invalid in the C11 Memory Model and what we can do about it

  • Max Planck Institute for Software Systems
  • INRIA Institut National de Recherche en Informatique et en Automatique

Research output: Contribution to journal › Article › peer-review

2 Citations (Scopus)

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.

Original languageEnglish
Pages (from-to)209-220
Number of pages12
JournalACM SIGPLAN Notices
Volume50
Issue number1
DOIs
Publication statusPublished - 14 Jan 2015

Keywords

  • c/c++
  • compilers
  • concurrency
  • program transformations
  • weak memory models

Fingerprint

Dive into the research topics of 'Common Compiler Optimisations are Invalid in the C11 Memory Model and what we can do about it'. Together they form a unique fingerprint.

Cite this