https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79979
--- Comment #2 from jdowdells at hotmail dot com --- Thanks for your quick reply. However, this is not intuitive, the compiler should be "free to do anything" in a sensible intuitive manner. The for loop is well defined and there is no conceivable circumstance that should allow it to loop forever. The optimized/unoptimized code should work the same but it does not. If you want to make the unoptimized code loop for ever I'll be more than happy Thanks again.