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

I added a few sentences about that to the post:

> In the case of our example, the program actually compares such an “unobservable” bit pattern with a constant, so the compiler constant-folds the result to whatever it pleases. Because the value is allowed to be “unstable”, the compiler does not have to make a “consistent choice” for the two comparisons, which would make such optimizations much less applicable. So, one time we “look” at x the compiler can pretend it is at least 150, and then when we look at it again it is at most 120, even though x did not change.

Also see http://nondot.org/sabre/LLVMNotes/UndefinedValue.txt.



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

Search: