>>106286803
>An infinite loop is considered undefined behavior
Only some infinite loops are undefine behavior. while (1) and for (;;) are explicitly blessed, and any other loop that's found to be infinite at compile time is supposed to work as expected although there have been a lot of compiler bugs about them. The optimizer is only allowed to assume loops are finite if it's not told they're infinite.