Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

When I tested this in the distant past, I found that all the compilers I tried generated exactly the same assembly for both loops.

I've seen it said that "The most optimizing compiler is the most normalizing compiler." [1] The infinite loop structure is pretty easy to normalize.

The only real difference that I saw was that some compiler front ends would produce warnings that the condition in the while loop was always true, where they seemed to assume the empty for must be intentional.

[1] https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-705.pdf



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: