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

The Watcom C/C++ compiler used to have a neat shift optimization bug.

If you shifted one way a few bits then shifted back a few bits (As you would in calculating addresses for graphics operations), the optimizer would think you were undoing the operation and do nothing. or interestingly shift n-m bits.

You had to do some dummy operation in between for the code to actually execute. This was true at least up to Watcom 11.



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

Search: