The issue seems to miss the heart of the problem. We know GCC and Clang have both intended for some time to treat undefined behavior as an opportunity to do whatever they want. If we assume the loop doesn't halt, we can remove the RET instruction. If we assume it does halt then we can remove the loop. Clang's internal model at HEAD appears to be assuming both outcomes happen simultaneously, which is clearly a bug, but could also indicate some kind of deeper policy change surrounding the liberties which are taken with behaviors that are undefined according to the C standard.