it's that very rare bird, a bona fide compiler bug.I can do you one better, and it was a compiler bug I created without even touching the compiler source code.I was one of two people writing an optimizer for the C compiler at Bell Labs. The way the compilation system worked, in those days, was for the compiler to produce a temporary file in assembly language and pass that file to the assembler. The way we designed the optimizer was to have it read the assembly code, optimize it, and put the optimized code into the assembler. That way, we could take the output of the C compiler, the C++ compiler (that did the same thing in those days), the FORTRAN compiler and run them all through the same optimizer and pipe it into the assembler.Well, I put a bug in the assembler that was only activated in some unusual code sequence. We had already run regression tests on both the C++ and C compilers, even built the whole UNIX kernel and tested that, and everything worked fine.Only trouble was that it made a slight error in compiling one particular program: the FORTRAN compiler. The FORTRAN compiler passed its regression tests, but a user got errors in his FORTRAN program. When all was said and done, we discovered the problem and I fixed it in a minute or two. But we first tried to find the error in the users program, and there was no error. We had not modified the FORTRAN compiler, so it could not have been the compiler -- but it was the only program we had that gave wrong results, namely bad executable programs. We rebuilt it with the optimizer turned off, and then it worked OK. So we knew it had to be the optimizer.Some problems are not easy to understand, are hard to find and, fortunately, are easy to fix.
Best Of |
Favorites & Replies |
Start a New Board |
My Fool |
BATS data provided in real-time. NYSE, NASDAQ and NYSEMKT data delayed 15 minutes.
Real-Time prices provided by BATS. Market data provided by Interactive Data.
Company fundamental data provided by Morningstar. Earnings Estimates, Analyst Ra