3 ms·
Three compiler codegen bug war stories: 1. libdivide found a gcc 4.8 vectorizer bug in high multiplies. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61108 http
by ridiculous_fish 9y ago
Three compiler codegen bug war stories:
1. libdivide found a gcc 4.8 vectorizer bug in high multiplies. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61108 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61108
2. Circa 2001, I decided to learn Java. My first-ever Java program performed a right shift by -1 (for some reason I can't recall but was probably really stupid). The spec requires this to be equivalent to >>31, but the compiler wrongly optimized it to >>0. My confused post can probably still be found in comp.lang.java.help.
3. I wrote a Python script that generated a large set of test cases for an FFI (NSInvocation). The test crashed inexplicably on PowerPC64 with a nonsense backtrace. Turns out the PPC64 jump instruction has a 24-bit literal offset, and my functions were so large they overflowed it. That got fixed (also in gcc).