News for hackers. Stuff that matters.
Re:I 10x'd a TI-84 emulator's speed by replacing a switch-case by dehrmann on Monday August 08, 2022 @02:47AM (#32382960)
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.
Re:I 10x'd a TI-84 emulator's speed by replacing a switch-case by carlmr on Monday August 08, 2022 @03:41AM (#32383197)
We 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?
Re:I 10x'd a TI-84 emulator's speed by replacing a switch-case by dehrmann on Monday August 08, 2022 @12:18PM (#32387476)
I 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.
Re:I 10x'd a TI-84 emulator's speed by replacing a switch-case by georgecmu on Monday August 08, 2022 @07:12AM (#32384233)
What processor was that for? I remember (1999-2000) we found out the hard way that GCC for Hitachi H8s had that exact bug.
Re:I 10x'd a TI-84 emulator's speed by replacing a switch-case by dehrmann on Monday August 08, 2022 @12:17PM (#32387451)
I think it was a generic mips CPU.
Re:I 10x'd a TI-84 emulator's speed by replacing a switch-case by throwawaysleep on Monday August 08, 2022 @07:43AM (#32384374)
Did you stick to it? I admittedly would have conceded I was wrong in that situation.
Re:I 10x'd a TI-84 emulator's speed by replacing a switch-case by dehrmann on Monday August 08, 2022 @12:14PM (#32387409)
I 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.