|
|
|
|
|
by fooker
1808 days ago
|
|
You are wrong. Optimizations directly enabled by Undefined behavior are only a very negligible part of the performance benefits of the existence of UB. For example, consider the fact that array access out of bounds is UB. Because of this a compiler can assume (without proof) that all accesses are actually going to be in range. This enables a boatload of loop optimizations. All non trivial optimizations done by a compiler usually assume such facts. |
|
It's a complete disaster on all sides.