2 ms·
For this particular edge case, yes it seems absurd. However, many optimization passes are based on simplifying code by figuring out what range of values somethi
by umanwizard 9y ago
For this particular edge case, yes it seems absurd. However, many optimization passes are based on simplifying code by figuring out what range of values something can take.
Most optimization passes don't know what the original code looks like, they only see it after it's been passed through a bunch of other optimization passes and preprocessing, so they can't reason about whether a particular optimization would seem "completely natural" or "abuse of UB" to the original programmer.