Conversation

Replying to and
it's not that nobody cares, it's that the standards committees explicitly decided to make compiler writers' jobs easier by making certain loops UB, and the LLVM compiler writers took advantage of the allowed leeway
1
We discussed this before. Loops with constant controlling expressions are explicitly not UB in C. Clang's optimization was (is?) structured in such a way that this got forgotten on some examples. An optimization that mistranslates one defined program is an incorrect optimization.
2
1
Here's an example: gist.github.com/thestinger/2a1 This program definitely shouldn't be printing "launch nukes". Beyond that, I think the libc implementation should be catching the stack overflow and stalling the thread. At least in my opinion, it's well defined as yelling forever.