|
|
|
|
|
by hramrach
1611 days ago
|
|
Don't compilers already have ways to mark variables and dereferences in a way to say 'I really want access to this value happen'? They are free to optimize away access to any result that is not used based on code elimination, and these annotations limit what can be eliminated. However, basing code elimination on UB, as pointed out earlier, would basically eliminate all code if you were rigorous enough because you basically cannot eliminate UB in C code, which is not in any way useful. |
|
The standard defines it, it's `volatile` I believe. But it does not help with the examples above as far as I understand (removing the log, removing the early return, time-travel...).