I mean, if you're going to argue that a compiler can do anything with any UB, then by all means make that argument.
Otherwise, then no, I don't think it's reasonable for a compiler to cause an infinite loop inside a function simply because that function itself doesn't return a value.
https://www.quora.com/What-is-the-most-subtle-bug-you-have-h...
The problem was that the loop itself was altered, rather than that the function returned and then that somehow caused an infinite loop.
> I'm not aware of any compiler that does that, but it's something I could see happening, and the developers would have no reason to "fix" it, because it's perfectly up to spec.
This is where we disagree.
https://people.csail.mit.edu/nickolai/papers/wang-stack.pdf
I submit that that's a small fraction of UB, that much of it would exist at any optimization level.