3 ms·
The bug is alarming. The code is not even peephole optimized up to 1985-ish standards Regarding { c, 0 } versus { c }, I don't expect in a mature C or C++ compi
by kazinator 6y ago
The bug is alarming. The code is not even peephole optimized up to 1985-ish standards Regarding { c, 0 } versus { c }, I don't expect in a mature C or C++ compiler for such high level differences in an expression to affect instruction selection. Both { c } and { c, 0 } say exactly the same thing: one member is initialized and the rest are zero. I would expect that there is no difference in intermediate representations at all, long before we get to a code generating back end. The compiler should convert the initializer to a canonical representation early on and not deal with different cases of it thereafter. This is definitely a WTH?
- gumby 6y ago> The bug is alarming. I used to run a compiler company (Cygnus). People were always complaining that the compiler was broken when the bug was in their code. That being said we also got lots of real bug reports and sometimes you'd look at them and say "how the hell does anybody compile code when this happens?" Of course really those cases were indeed bad but only infrequently triggered. But they are codebases like any other and code has bugs. I still find bugs every few months in various compilers. Usually they are already known. And code quality bugs are lower priority than conformance (accuracy) bugs.