3 ms·
> All "undefined behavior" that I have seen could have been replaced with "the compiler can do one of these three things" and still been widely efficient The p
by josephcsible 5y ago
> All "undefined behavior" that I have seen could have been replaced with "the compiler can do one of these three things" and still been widely efficient
The point of undefined behavior is that it's a list of things that the compiler is allowed to assume that you'll never do. A lot of optimizations come from being allowed to make this assumption and propagate it backwards, which can't be done at all if the compiler would have to do one of a defined list of things instead.