Rust and GCC, two different ways
Rust and GCC, two different ways
Posted Oct 11, 2021 16:34 UTC (Mon) by ssokolow (guest, #94568)In reply to: Rust and GCC, two different ways by Wol
Parent article: Rust and GCC, two different ways
Based on my understanding of the terms, you two are talking about "implementation-defined behaviour".
"Undefined behaviour" is used in the mathematical sense of "undefined". It's like taking the result of dividing by zero.
As such, undefined behaviour is stuff where the compiler optimizers are allowed to transform their input based on the assumption that it can never happen.
See, for example, Why undefined behavior may call a never-called function and How undefined signed overflow enables optimizations in GCC by Krister Walfridsson.
I have a bunch of links to other resources in this reddit comment if you want more.
