Hacker News new | ask | show | jobs
by pornel 1314 days ago
In case of a CPU it's safer, because the existing hardware definitely won't change, and you can hope the vendor won't do anything drastic in microcode updates.

But UB in a language with an optimizer is a bigger gamble. Even changes to code outside of your UB-tainted function may trip inlining and hot code heuristics, which may make more or less of the code visible to the optimizer, which may make it take advantage of different "undefined" assumptions.