Displaying 2 results from an estimated 2 matches for "d172501a".
2017 Dec 23
0
Hoisting in the presence of volatile loads.
Hello.
This might be a trivial question, but is it correct if the signal handler
aborts the program?
For example:
int *normal = ADDRESS1;
volatile int* ptr = ADDRESS2;
int k = *ptr; // segfaults, and the signal handler calls abort()
int value = *normal; // this may be UB(undefined behavior).
Let's assume that normal is dereferenceable if ptr1 does not raise SEGSEGV,
but accessing
2017 Dec 20
4
Hoisting in the presence of volatile loads.
On 12/20/2017 1:37 PM, Sanjoy Das wrote:>
> Fwiw, I was under the impression that regular loads could *not* be
> reordered with volatile loads since we could have e.g.:
>
> int *normal = &global_variable;
> volatile int* ptr = 0;
> int k = *ptr; // segfaults, and the signal handler writes to *normal
> int value = *normal;
>
> and that we'd have