5 ms·
The compiler can just assume that any given call will halt for this purpose. Nobody is likely to care if there is an unnecessary instruction before an infinite
by amalcon 12y ago
The compiler can just assume that any given call will halt for this purpose. Nobody is likely to care if there is an unnecessary instruction before an infinite loop.
Edit: To clarify, the general strategy here is to apply the optimization if and only if the compiler can prove it valid (which will be most of the time).
Personally, I prefer the strategy of having the compiler produce an error when it can't prove something is initialized, but auto-initialization only when necessary is totally possible in a huge majority of practical cases.