As a long-time Asm programmer who has read a lot of compiler-generated code (usually for RE purposes), I completely sympathise with Linus - despite all the research and improvements, compilers are still very stupid, and will routinely generate code that no sane human would. The widespread notion that compilers can almost always generate better (faster or smaller) code than a human is probably closer to myth than reality. The one thing that is certainly true is they can compile orders of magnitude faster than a human can, and that's usually the main reason for using them.
I think the x86-64 ABI is also partly to blame for this mess - IMHO it's far too complex (e.g. the "red zone") and makes it easy for these bizarre edge-case-bugs to occur.
"Spilling a constant" is something I've never seen before and I'd probably WTF the first time I saw it, but thinking about it more carefully, it might actually be a wise choice in some cases - x86-64 unfortunately allows very few instructions with 64-bit immediate values, and those few instructions are very long (opcode + 8-byte immediate), so it could make sense to store some constant in memory, on the stack, for a while and put it in a register when it's needed with some moves - 64-bit r/m move with 8-bit displacement is 3/4 bytes. Of course that's not what GCC is doing here; that last move instruction is 6 bytes alone (mov + mod/rm + disp32.)
The tone difference is certainly stark! The bug report feels like a process is in play, while the mail has a tone of a rant in a closed room.
I often take it for granted the compiler is always right (and it darn well just about is), but bugs like this look exactly like mis-cast magic to me. Learning how the compiler makes decisions seems like a rabbit hole, but may be fascinating enough to be worth it. (And think about being a maintainer of such a complex beast!)
Can anyone give a layperson's explanation of what exactly GCC 4.9 is doing wrong here? I'm not fluent in Assembly and/or compiler internals. What's changed from 4.8?
I've noticed it also has idiotic warnings. I have some code with macrology that generates lexically scoped typedefs, which are sometimes not used. I do not wish to be warned about these, damn it! Who cares about a typedef at lexical scope that is not used? It's compile-time only. What's next; a warning about every file-scope typedef that has not been used? "Hey you included <stddef.h> but never used ptrdiff_t!"
I really enjoyed reading this even I don't understand any of what the bug is actually about. There's something about people who have taken swearing to a virtuosic level.
I initially felt the same, but imagine if you'd spent countless hours getting to the bottom of an obscure bug that turned out to be a completely bone-headed compiler problem outside your control. Sometimes I think Linus goes a bit far, but this time I think he's justified in his venting his irritation
As in, Torvalds being mean about the compiler, or something else? That seems pretty par for the course in the context of a badly-broken thing that people tend to expect never to be broken.
He isn't a peer though. It's like how the hermit at the top of the mountain will smack the novice martial artist for making little mistakes. That doesn't make the novice resentful. Instead, he's glad for the training.
Non native speakers often don't have the instinctual grasp of slang and swearwords in English and so tend to use the F C and S words a lot without fully understanding the severity of the words.
"seriously crazy shit" seems a bit restrained for Linus though
I'm really baffled about this. Maybe I'm from older hacker generation (and I'm also a Finn). I just did not see personal insults going on. I would like to see more neutral discussion about cultural differences (between hackers and nations) and not opinions and own cultural biases stated as normative.
Here is my personal cultural bias:
1. Insulting people personally is not same thing as insulting their ideas or their actions. If someone insults my actions or my ideas, I may get emotional, but I don't take it as an insult. For me it means that I'm being challenged.
2. Cursing is not unprofessional or insulting in itself. Cursing is to be used for emphasis and to get people involved emotionally (good thing). Cursing has its place to signal frustration and get trough people. Too much cursing is like underlining everything.
3. (Anglo American) business culture is not necessarily something to be emulated. Being overly polite invites all kinds of side stepping, passive aggressive behavior and ineffectiveness. I feel that "being professional" is used here as thought terminating cliche.
4. Some hacker cultures can be both fiercely competitive and cooperative at the same time. Being heavily criticized and challenged is part of that process. Kernel hackers compete to get their ideas incorporated into the same codebase. Javascript hackers borrow snippets from each other and do their own things (no need to be as competitive as forking is easier). This might lead to different hacker cultures. What is accepted in one culture is not accepted in other.
5. Management by perkele[1] is management strategy that can be very effective with the 'Shut Up and Show Them the Code' hacker culture.
6. Pacabel may have a point. Younger generations may no be used to their work or behavior being harshly criticized and take it as personal insult. https://news.ycombinator.com/item?id=8089706
My theory about this is that Linus treats his mailing list like a semi-public IRC chatroom (I mean, it is his mailing list for his kernel, so it makes sense) and HNers are not accustomed to that kind of cross-over if they've even ever idled on an irc channel run by hackers. It usually gets much more crass in there, so in that context these kind of comments make sense.
But when you consider Linus is responsible for, I dunno, billions? trillions? in spending on technology based on his OS, it's also easy to understand people getting nervous or offended by IRC-style banter. It's like seeing the CEO of a large company make jokes about retards. Pretty off-putting.
(And no, of course Linus is not a "CEO of Linux" and he doesn't owe anybody anything, i'm just saying I get how people could feel shocked or offended by his behavior)
Seriously. If a community/somebodey cares more about how something is said more than what is said, said community/person lacks the allegedly so important professionalism.
Linus has earned the right to that tone, care about Linux or not. Now when some unknown emulates it, that's the time to take note (and ignore that person ever after).
Unfortunately the linux kernel still relies on some gnu C extensions for some low-level control of the output. I don't know if comparable stuff exists in llvm and clang, and if so, if linus has any plans on supporting them. However this is just bugs in a new compiler, and the Linux kernel is probably one of those things that hits cornercases.
The optimiser in LLVM does some even more "seriously crazy shit" - usually revolving around obscure edge cases involving officially undefined behaviour. Linus would definitely not be happy with that.
[+] [-] userbinator|11 years ago|reply
I think the x86-64 ABI is also partly to blame for this mess - IMHO it's far too complex (e.g. the "red zone") and makes it easy for these bizarre edge-case-bugs to occur.
"Spilling a constant" is something I've never seen before and I'd probably WTF the first time I saw it, but thinking about it more carefully, it might actually be a wise choice in some cases - x86-64 unfortunately allows very few instructions with 64-bit immediate values, and those few instructions are very long (opcode + 8-byte immediate), so it could make sense to store some constant in memory, on the stack, for a while and put it in a register when it's needed with some moves - 64-bit r/m move with 8-bit displacement is 3/4 bytes. Of course that's not what GCC is doing here; that last move instruction is 6 bytes alone (mov + mod/rm + disp32.)
[+] [-] e40|11 years ago|reply
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61904
[+] [-] HCIdivision17|11 years ago|reply
I often take it for granted the compiler is always right (and it darn well just about is), but bugs like this look exactly like mis-cast magic to me. Learning how the compiler makes decisions seems like a rabbit hole, but may be fascinating enough to be worth it. (And think about being a maintainer of such a complex beast!)
[+] [-] wfunction|11 years ago|reply
Do you happen to know how that is done? How is a test case "auto"-reduced? I've never done that before.
[+] [-] frik|11 years ago|reply
[+] [-] rwmj|11 years ago|reply
[+] [-] davidgerard|11 years ago|reply
[+] [-] reidrac|11 years ago|reply
[+] [-] quarterto|11 years ago|reply
[+] [-] kazinator|11 years ago|reply
[+] [-] jonahx|11 years ago|reply
[+] [-] andrey-p|11 years ago|reply
[+] [-] unknown|11 years ago|reply
[deleted]
[+] [-] unknown|11 years ago|reply
[deleted]
[+] [-] Aardwolf|11 years ago|reply
[+] [-] recalibrator|11 years ago|reply
His words shouldn't be taken too personally, just as getting bitten by a grizzly bear shouldn't be taken personal.
[+] [-] caf|11 years ago|reply
[+] [-] smcl|11 years ago|reply
[+] [-] Argorak|11 years ago|reply
http://arstechnica.com/information-technology/2013/07/linus-...
[+] [-] rsynnott|11 years ago|reply
[+] [-] Svip|11 years ago|reply
[0] He is after all warning about the use of gcc-4.9.0
[+] [-] droopyEyelids|11 years ago|reply
[+] [-] test1235|11 years ago|reply
[+] [-] cottonseed|11 years ago|reply
http://philip.greenspun.com/ancient-history/professionalism-...
[+] [-] stickydink|11 years ago|reply
[+] [-] tonfa|11 years ago|reply
[+] [-] unknown|11 years ago|reply
[deleted]
[+] [-] macspoofing|11 years ago|reply
[+] [-] walshemj|11 years ago|reply
"seriously crazy shit" seems a bit restrained for Linus though
[+] [-] gkya|11 years ago|reply
[+] [-] lodewijkadlp|11 years ago|reply
[deleted]
[+] [-] AgathaTheWitch|11 years ago|reply
Prediction before clicking: Half of the thread, or more, will not be about what he says, but about his tone and "professionalism."
Never change HN. Never change.
[+] [-] dang|11 years ago|reply
Please don't.
[+] [-] nabla9|11 years ago|reply
Here is my personal cultural bias:
1. Insulting people personally is not same thing as insulting their ideas or their actions. If someone insults my actions or my ideas, I may get emotional, but I don't take it as an insult. For me it means that I'm being challenged.
2. Cursing is not unprofessional or insulting in itself. Cursing is to be used for emphasis and to get people involved emotionally (good thing). Cursing has its place to signal frustration and get trough people. Too much cursing is like underlining everything.
3. (Anglo American) business culture is not necessarily something to be emulated. Being overly polite invites all kinds of side stepping, passive aggressive behavior and ineffectiveness. I feel that "being professional" is used here as thought terminating cliche.
4. Some hacker cultures can be both fiercely competitive and cooperative at the same time. Being heavily criticized and challenged is part of that process. Kernel hackers compete to get their ideas incorporated into the same codebase. Javascript hackers borrow snippets from each other and do their own things (no need to be as competitive as forking is easier). This might lead to different hacker cultures. What is accepted in one culture is not accepted in other.
5. Management by perkele[1] is management strategy that can be very effective with the 'Shut Up and Show Them the Code' hacker culture.
6. Pacabel may have a point. Younger generations may no be used to their work or behavior being harshly criticized and take it as personal insult. https://news.ycombinator.com/item?id=8089706
[1]: https://en.wikipedia.org/wiki/Management_by_perkele#Examples...
[+] [-] danford|11 years ago|reply
Forget to turn off a mic at a political conference? You get worse stuff than this.
[+] [-] peterwwillis|11 years ago|reply
But when you consider Linus is responsible for, I dunno, billions? trillions? in spending on technology based on his OS, it's also easy to understand people getting nervous or offended by IRC-style banter. It's like seeing the CEO of a large company make jokes about retards. Pretty off-putting.
(And no, of course Linus is not a "CEO of Linux" and he doesn't owe anybody anything, i'm just saying I get how people could feel shocked or offended by his behavior)
[+] [-] mzwartbol|11 years ago|reply
[+] [-] 1ris|11 years ago|reply
[+] [-] aeberbach|11 years ago|reply
[+] [-] GFK_of_xmaspast|11 years ago|reply
[+] [-] parax|11 years ago|reply
[+] [-] keeperofdakeys|11 years ago|reply
[+] [-] kzrdude|11 years ago|reply
[+] [-] a3_nm|11 years ago|reply
[+] [-] userbinator|11 years ago|reply
[+] [-] _stephan|11 years ago|reply