by symmetricsaurus · 4y ago · 0 comments
Perhaps with out of order CPUs relying on something that is undefined could change based on adjacent instructions also?
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.