Displaying 2 results from an estimated 2 matches for "zh1tey".
Did you mean:
thtey
2017 Dec 23
2
Hoisting in the presence of volatile loads.
...UB" is enough to
justify this optimization. Don't you also need "accessing a non-volatile object
through a volatile pointer is UB"?
In other words, if I understand correctly, this proposed reordering could change
the behavior of the following program: <https://godbolt.org/g/zH1Tey>
static void foo(int *x, volatile int *y) {
// These may be reordered now?
*x = 4;
*y = 5;
}
int bar() {
int x = 0;
foo(&x, (volatile int*)&x);
return x; // MUST return 5
}
`x` and `y` alias in `foo` and both point to a non-volatile object; reordering
them ch...
2017 Dec 21
4
Hoisting in the presence of volatile loads.
On 12/20/2017 03:49 PM, Alina Sbirlea via llvm-dev wrote:
> +Philip to get his input too.
> I've talked with George offline, and here's a summary:
>
> In D16875 <https://reviews.llvm.org/D16875>, the decision made was:
> "The LLVM spec is ambiguous about whether we can hoist a non-volatile
> load above a volatile load when the loads alias. It's probably