Mostly-Unfair Criticisms of GCC
Mostly-Unfair Criticisms of GCC
Posted Oct 25, 2007 6:49 UTC (Thu) by rmathew (subscriber, #20961)Parent article: A potential competitor for GCC: pcc
(Disclaimer: I used to be a fringe contributor to GCC some time back.) GCC is a compiler for multiple languages and for multiple platforms. It can work as a native compiler, a cross compiler and even a crossed-native compiler (See http://gcc.gnu.org/onlinedocs/gccint/Configure-Terms.html for the meaning of these terms). It is very difficult to quickly produce good code under such conditions. Given that, it is amazing that it is able to do what it does. By its very nature, a production-quality compiler is a complex beast and GCC is particularly complex. There are very few people qualified enough to make significant changes to such software. Being paid to do so helps considerably when you take the time and effort involved into account. It is no wonder that the major contributors are employed by Red Hat, Code Sourcery, Google, Apple, etc. The GCC maintainers do not take a particular pleasure in removing support for various architectures. As the compiler evolves, someone who cares about an architecture needs to maintain the respective back-end and regularly post the results of running the GCC test-suite to the "gcc-testresults" mailing list (so that other maintainers can check the health of GCC for such an architecture). If there is no such visible proof of an architecture being maintained and no responses to pleas of help on the GCC mailing lists to help maintain the respective back-end, it is natural for the GCC maintainers to assume that no one is interested in maintaining the back-end. Such a back-end needs to be removed to keep the code-base maintainable. Even then, an architecture is first deprecated in a release (and an announcement made so that some one who cares can still offer some help) and then removed in a subsequent release - this gives about two years for some one who cares about the architecture to save it. i386 is used by the vast majority of the users of GCC as well as the companies that support GCC, so it is not surprising that it is in the best shape. There is no conspiracy to turn it into a "commercial" compiler with support only for i386. Having said that, some of the criticisms are valid. GCC is indeed getting more and more complex with each release, not to mention slower and slower. As with any complex software, it is easier to add new features or fix bugs that your customers care about than spend time and effort refactoring it and making it faster (but amazingly, such work still happens with GCC). GCC is intentionally not "modular" with parts that can be cleanly separated and used because RMS was afraid that nefarious people would be able to use this to subvert the GPL. In fact, for the same reason, he was opposed for some time to the idea of the Java compiler (GCJ) being able to produce JVM byte-code. Fortunately, good sense prevailed. As GCC adds more and more front-ends and back-ends, it becomes more and more difficult to ensure that your patch does not break anything. The GCC bootstrapping process and its regression suite takes longer and longer. This raises the barrier for anyone contemplating to contribute to GCC. Perhaps GCC should just go back to being a good C/C++ compiler.
Posted Oct 25, 2007 9:28 UTC (Thu)
by nix (subscriber, #2304)
[Link]
Posted Oct 26, 2007 17:50 UTC (Fri)
by elanthis (guest, #6227)
[Link]
Mostly-Unfair Criticisms of GCC
I thought that the Apple folks did some cachegrinding and found the problem to be largely
GC-related poor memory locality and a correspondingly awful rate of cache misses?
(IIRC this is being fixed by going back to obstacks in hot spots, but of course new
optimizations are landing at a rate of knots which is slowing everything right back down
again.)
Mostly-Unfair Criticisms of GCC
"GCC is intentionally not "modular" with parts that can be cleanly
separated and used because RMS was afraid that nefarious people would
be able to use this to subvert the GPL."
His usual nonsense that stops Free Software from actually being useful to more people.
Really, what is the point of Free Software if you go out of your way to make sure that people
can't use it? You can't eliminate non-Free software if you constantly validate it by
artificially restricting the usefulness of Free Software.
It's especially silly since restricting GCC from being modular doesn't actually stop non-Free
software from using GCC as an intermediary. If LLVM can add a backend to GCC, so can anyone
else, and a company could add a backend to generate some intermediary format and then process
that with their non-Free tools in a separate binary. It would take some work, but if a
company really wanted a GCC front-end that badly, nothing in the world is stopping them.
