|
|
|
|
|
by gpderetta
721 days ago
|
|
> The issue discussed is that based on assumptions about UB, the compiler emits code that does not correspond to the source in an intuitive way, for example a branch of code is entirely removed, including any observeable side-effects that logically happened before the UB. That's literally what happens in my example: the div is hoisted above the volatile read which is an observable side effect. The practical effect is that the expected side effect is not executed even if it should have happened-before the SIGFPE. uecker claims that the UB should still respect happens-before, and I'm inclined to agree that's an useful property to preserve. And I don't see any significant difference between my example and what you are arguing. |
|