3 ms·
In my 25 years working with c++ I’ve encountered just one compiler bug - msvc hard crash no error - found that reversing the order of two int declarations fixed
by klik99 4y ago
In my 25 years working with c++ I’ve encountered just one compiler bug - msvc hard crash no error - found that reversing the order of two int declarations fixed it. Was quite a while ago. It’s insane how rare bugs are in these incredibly complicated programs. Annoyances? Oh sure there’s a ton, but straight up bugs are so close to non existent it’s safer to say “it’s never a compiler bug”
- FartyMcFarter 4y agoI've seen quite a few compiler bugs, but they're almost always in new features rather than the stuff everyone's been using for years. As examples, I've seen intrinsics for new x86 instructions being broken in both GCC and Intel's compiler, as well as Profile-guided optimizations crashing in MSVC with a large program (I reported this to MS but I'm not sure they ever got around to looking at it). The lesson I took from this is to not use the latest and greatest features except in toy projects.
- benibela 4y agoThe mainstream compilers are rather robust I use a niche language. It feels like I find a compiler bug there every month.
- pfdietz 4y agoI feel that niche language implementations need to be more rigorously tested, because they have fewer users testing them "for free" (not that that would be sufficient.)
- DylanSp 4y agoSimilar experience here, the one compiler bug I've found (a Typescript type-checking bug) was in a feature that had just been released.
- maccard 4y agoI've been on the unfortunate end of compiler bugs on multiple occasions - ICEs, invalid codegen and invalid optimisations. It still takes a lot to convince me it's a compiler bug it they seem to be like pringles - once you start you can't stop.
- yakubin 4y agoI think it's more productive not to assume a religious stance on whether compiler has bugs one way or the other. If there is something wrong, better to read the language spec, the ABI spec and the machine code the compiler generated and judge for yourself. People who, given an extensive description of what compiler did and why it's wrong, get back at you with the religious "it's never a compiler bug" just make me not want to talk to them.
- 3836293648 4y agoI encountered two or three compiler bugs within weeks of starting to (seriously) work with C++. And one of them was as simple as enabling lto caused GCC to segfault.