6 ms·
Assuming you meant "I'm waiting to see an A:B test that shows compiler optimizations that assume there is no undefined behavior in the program being compiled le
by maxlybbert 10y ago
Assuming you meant "I'm waiting to see an A:B test that shows compiler optimizations that assume there is no undefined behavior in the program being compiled lead to a binary that runs faster" or something similar: each time somebody adds any kind of optimization to a compiler, they have to first check that the optimization actually leads to a faster binary.
I'm not aware of any good way to request "all optimizations except the ones that rely on undefined behavior," so it would be very difficult to get this kind of test. But it's also true that whenever somebody files a bug against a compiler because the compiler did something unexpected when the programmer triggered undefined behavior (e.g., expected signed integer arithmetic to wrap, dereferenced a null pointer, got aliasing rules wrong, etc.) the compiler team is able to quickly point out the the performance gain from that particular optimization (e.g., "having signed integer overflow undefined means that tight loops run up to 20% faster").