4 ms·
I don't think this is true, though I think it's a common misconception. Undefined behavior is not meant to be an optimization tool. It's meant to be an anti-pes
by wfunction 9y ago
I don't think this is true, though I think it's a common misconception. Undefined behavior is not meant to be an optimization tool. It's meant to be an anti-pessimization tool. In other words, it's meant to eliminate overhead in cases where the programmer knows it is unnecessary, but which the compiler cannot prove. Eliminating overhead is conceptually very different from actively allowing insane behavior just to increase optimization opportunities.