All Questions
2 questions
1
vote
4
answers
985
views
How compiler enforces C++ volatile in ARM assembly
According to cppreference, store of one volatile qualified cannot be reordered wrt to another volatile qualified variable. In other words, in the below example, when y becomes 20, it is guaranteed ...
5
votes
2
answers
322
views
Do C90-compliant compilers have to take into account instruction reordering by the CPU?
Consider the following piece of code:
volatile int a;
volatile int b;
int x;
void func() {
a = 1;
x = 0; /* dummy statement */
b = 2;
}
In this code snippet, the assignment to x ...