News for hackers. Stuff that matters.
Re:Tell HN: C Experts Panel – Ask us anything about C by iainmerrick on Tuesday April 14, 2020 @03:05PM (#22870104)
What I’m driving at is, if the loop really doesn’t terminate, it would still be safe to do that optimization because the incorrectly-optimized code would never be executed.

I guess that doesn’t necessarily help in the “+=2” case, where you probably want the optimizer to do a “result += x/2”.

In general, I’d greatly prefer to work with a compiler that detected the potential infinite loop and flagged it as an error.

There are no comments on this comment yet.