15 ms·
In my first job out of school, I was writing driver code in C. In one of my projects, I had a code block that wasn't working, but all it did was a switch on int
by dehrmann 4y ago
In my first job out of school, I was writing driver code in C. In one of my projects, I had a code block that wasn't working, but all it did was a switch on ints. On a hunch, I tried ifs, and it worked. Turns out I found a bug in the in-house GCC fork. I'm sure my manager thought I was an idiot--I was a new grad saying my project isn't working, and I think it's a compiler bug.
- carlmr 4y agoWe always assume compilers to be infallible, and for the most part this is right. But special compilers for special targets or certified compilers for special uses, I've found to often have compiler issues. Why did you have a GCC-fork?
- dehrmann 4y agoI wish I could remember. It wasn't a secret sauce thing, so all I can think of is you get improved support and faster bugfixes.
- georgecmu 4y agoWhat processor was that for? I remember (1999-2000) we found out the hard way that GCC for Hitachi H8s had that exact bug.
- dehrmann 4y agoI think it was a generic mips CPU.
- throwawaysleep 4y agoDid you stick to it? I admittedly would have conceded I was wrong in that situation.
- dehrmann 4y agoI did! The compiler team agreed that it was broken and gave me a flag to disable jump tables. Surprisingly, that didn't cause any noticeable performance regressions.