Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages 2015
DOI: 10.1145/2676726.2676995
|View full text |Cite
|
Sign up to set email alerts
|

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-tosource 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 propo… Show more

Help me understand this report

Search citation statements

Order By: Relevance

Paper Sections

Select...
2
1
1
1

Citation Types

1
87
0

Year Published

2015
2015
2024
2024

Publication Types

Select...
5
3

Relationship

2
6

Authors

Journals

citations
Cited by 102 publications
(88 citation statements)
references
References 22 publications
1
87
0
Order By: Relevance
“…As part of this process, they produced a verified compilation scheme from C11/C++11 onto the x86, ARM, and Power MCMs [8,45]. Vafeiadis et al developed various methods for proving the correctness of operations performed within a C11 compiler [53,54]. Petri et al developed an operational model of Java which specifically focused on its mapping onto x86 and Power [42].…”
Section: Related Workmentioning
confidence: 99%
“…As part of this process, they produced a verified compilation scheme from C11/C++11 onto the x86, ARM, and Power MCMs [8,45]. Vafeiadis et al developed various methods for proving the correctness of operations performed within a C11 compiler [53,54]. Petri et al developed an operational model of Java which specifically focused on its mapping onto x86 and Power [42].…”
Section: Related Workmentioning
confidence: 99%
“…• the reads-from relation links write events to read events, such that every read observes exactly one write, and the locations and 5 This set is sometimes called the 'pre-executions' [7] or the 'opsems' [39]. values match; that is,…”
Section: C11 Executionsmentioning
confidence: 99%
“…The C11 memory model has been formalised by several researchers, in varying degrees of completeness, and with varying degrees of fidelity to the standard [2,7,38]. These formalisation efforts have proved fruitful; they have, for instance, enabled the construction of simulators that automatically explore the allowed behaviours of small C11 programs (called litmus tests) [2,7,13,29], underpinned the design of program logics for specifying and verifying C11 programs [37,38], and they provide a firm foundation for ongoing debate about the design of the C11 memory model itself [10,39]. The OpenCL memory model (introduced in version 2.0 of the standard) has received comparatively little academic attention, with the notable exception of the work of Gaster et al [17], which we discuss further in §7.…”
Section: Introductionmentioning
confidence: 99%
“…In this section, we try to give some intuition for the semantics of these operations. Thorough, formal presentations of the C11 memory model can be found in Batty et al [3] and Vafeiadis et al [20].…”
Section: Release-acquire Semanticsmentioning
confidence: 99%
“…There are several reasons. First, the semantics of C11's release-acquire mode has been fully formalized [3], rendering our RCU implementation amenable to formal verification, and unlike several other features of the C11 model [20], its semantics is relatively uncontroversial. Second, release-acquire semantics, while significantly weaker than SC, nevertheless provides sufficiently strong synchronization to guarantee safety of our RCU implementation.…”
Section: Introductionmentioning
confidence: 99%