Slashdot Mirror


Comparing Linux C and C++ Compilers

ChaoticCoyote writes "I've posted a comparison of recent GCC versions (3.3, 3.4, and the coming 4.0) with Intel C++ 8.1, including several benchmarks and "state-of-the-product" reviews. The new article replaces an older piece I published in late 2002. This new comparison marks what I hope will be an ongoing series that tracks the quality of Linux compilers."

58 of 379 comments (clear)

  1. gcc! by dosius · · Score: 4, Insightful

    well, GCC has one thing going for it - it's open source - and that's why I'm sticking with it. XD

    FP?

    Moll.

    --
    What you hear in the ear, preach from the rooftop Matthew 10.27b
    1. Re:gcc! by Anonymous Coward · · Score: 5, Informative

      GCC has other things going for it, too.

      ProPolice stack smashing protection patches for one. (and many others besides.)

      And cross-platform compatability. I can compile for targets. Like working on embedded products.

      Oh, and Distcc for realy big projects to get compiled quickly using easy to setup clusters.

      It's "correctness" is pretty high up their, too.

      Remember, for Unix:
      compatability, portability, flexibility > speed.

      If all you ever have to worry about is x86, then it's not that big of a problem, but for anything else there is no comparision to GCC that I am aware of.

      That it having it free software rocks.

    2. Re:gcc! by antifoidulus · · Score: 4, Insightful

      Yeah but how important is ultra-high performance for you? If you are in charge of a multi-million dollar super computer, I would hope that you wouldn't say, "Well, I can get better performance out of this commerical compiler, but I disagree with commercial software, so I'll use open source"
      My view on the whole open-vs-closed debate is whatever gets the job done. There are a lot of open source tools that get the job done quite well, and I use those. But there are also occaisions where proprietary software gets what I need done quicker and easier, so I'll use that.

    3. Re:gcc! by k4_pacific · · Score: 4, Funny

      In other words, you can compile GCC with the Intel compiler, but not the other way around.

      Seems like there's an "In Soviet Russia" joke in there somewhere.

      --
      Unknown host pong.
    4. Re:gcc! by UnderScan · · Score: 5, Informative

      Nope, no troll.
      Icecream is created by SUSE and is based on ideas and code by distcc. Like distcc it takes compile jobs from your (KDE) build and distributes it to remote machines allowing a parallel build on several machines you've got. But unlike distcc Icecream uses a central server that schedules the compile jobs to the fastest free server and is as this dynamic. This advantage pays off mostly for shared computers, if you're the only user on x machines, you have full control over them anyway.

    5. Re:gcc! by vadim_t · · Score: 4, Informative

      I don't know what's up with distcc, but every time I try it, it ends failing at some point. For example a few days I was installing Gentoo, with CFLAGS having -fstack-protector, and distcc crashed somewhere in the bootstrap due to the stack protection. I didn't figure out if it's some kind of conflict, or the stack protector kicked in due to a bug.

      I also heard reports from people about Gentoo not completing the basic installation when trying to do with with distcc even without the stack protector.

      The idea itself is really nice, but at least for me doesn't seem to work nearly as well as it should.

    6. Re:gcc! by Xabraxas · · Score: 4, Insightful
      Sorry but... ProPolice sucks.

      Why?

      Nobody cares about stack smashing protection anymore these days.

      OpenBSD

      Hardened Gentoo

      GCC 4.0 has libmudflap and -fmudflap for C and C++. While this isn't exactly the same as stack smashing protection, it is still very effective and much more efficient.

      Last time I checked GCC 4.0 wasn't stable.

      It's not entirely without reason that IBM still hasn't posted ProPolice for inclusion in the FSF GCC mainline. The patch against SUSE's hammer branch has been floating around literally for years, but they know really only very few people truely believe it makes a difference.

      That's crap. Propolice does exaclty what it is supposed to do. It doesn't protect against all stack smashing attacks but no one ever claimed that it did.

      --
      Time makes more converts than reason
    7. Re:gcc! by Xabraxas · · Score: 3, Informative

      I thought in the docs it says not to use distcc for the bootstrap process. Perhaps I am wrong but I thought I remember seeing that. Then again, it's been quite a while since I've installed Gentoo. Distcc works fine for me after installation though.

      --
      Time makes more converts than reason
    8. Re:gcc! by Sipos · · Score: 4, Insightful

      It seemed to be surprisingly fast in these benchmarks. Did you see the size of the icc binaries. I am not sure what the options for icc mean but I guess they must be doing loop unrolling/peeling and aligning functions to improve the cache useage. If you enable these on gcc you can gain a huge increase in performance (at the expense of larger code size). It may well be able to produce faster binaries than icc for the same size in many of the tests.

    9. Re:gcc! by ken_i_m · · Score: 5, Informative

      The gcc is not a linux compiler. The g stands for Gnu. The linux kernel and the systems built around it are most often compiled with the gcc. The gcc existed long before Linus's first kernel release.
      --
      ken_i_m
      Founder, Bozeman Linux User Group

    10. Re:gcc! by adamwood · · Score: 5, Interesting

      Erm. If you look at the current top500 you'll see that there's a Xeon machine in the top 5.

      Have you actually tried other platforms? The best compiler on a given architecture is usually the chip vendor compiler -- IBM's compiler beats GNU on PPC 970, HP's beats GNU on Alpha, etc.

      Sure you can find the odd piece of code where Gnu will beat vendor compilers but overall, and particularly for large scientific workloads, vendor compilers win for raw speed.

    11. Re:gcc! by bit01 · · Score: 4, Insightful

      "is $x > $y?"

      This is only true if you include all costs and benefits, not just the sticker price.

      Commercial vendors would love for customers to consider only the sticker price without taking into account the many hidden and recurring costs in most commercial software solutions.

      ---

      Astroturfers are scum.

  2. 3.5 vs. 4.0 by slavemowgli · · Score: 3, Interesting

    Interesting. Something I don't understand, though, is why the article talks about both gcc version 4.0 and "the upcoming-3.5"; will there be a 3.5 version before 4.0, or is that simply a typo?

    --
    quidquid latine dictum sit altum videtur.
    1. Re:3.5 vs. 4.0 by kristofme · · Score: 5, Informative

      The current version of GCC is 3.4.2, and the next planned version will be called 4.0.0
      More info on the GCC site

    2. Re:3.5 vs. 4.0 by Aardpig · · Score: 3, Informative

      I'm not sure, but I'd guess that 4.0 is the place where major development is happening, where major changes/improvements are made, whereas 3.5 is where minor/incremental stuff is being done.

      I'm afraid you're wrong. 3.5 is the current development version of GCC. Amongst other things (which include a new Fortran 95 frontend -- hurrah!), it uses a wholly-new optimization architecture known as 'Tree-SSA'. This change is so radical that it was recently decided that 3.5 should actually be released as new major revision -- i.e., 4.0 -- rather than as 3.6 (recall that many open source projects use odd minor version numbers for development branches, and even ones for stable releases). Therefore, 4.0 is what 3.5 will be once it is released as stable.

      You may recall that a similar version renaming was mooted for the latest Linux kernel, but it was decided to leave it as 2.6 rather than 'upgrading' it to 3.0.

      --
      Tubal-Cain smokes the white owl.
    3. Re:3.5 vs. 4.0 by ChaoticCoyote · · Score: 5, Informative

      The GCC Steering Committee changed the next version of GCC from 3.5 to 4.0 while I was in the midst of writing the article. I missed changing a reference; the typo is now fixed.

    4. Re:3.5 vs. 4.0 by FullMetalAlchemist · · Score: 5, Interesting

      Tree-SSA is not new, it's new to GCC but the concept of Single Static Assignment itself is ancient and using it for optimizing trees in not new.
      The problem is the GCC codebase is so badly designed it takes major changes to many parts to introduce a very old concept of SSA into it. So you can't take advantage of a generic SSA but have to introduce different patches for the system.

      Back in my university days we did SSA in our own compilers, for a 5 week course! GCC needs a complete rewrite or a switch to something like TenDRA, which right now produces good solid code, but not extremely optimized machinecode. On the other hand TenDRA is really well designed so it would catch up really fast if more people worked on it.

    5. Re:3.5 vs. 4.0 by multipart · · Score: 3, Informative

      I would certainly hope there will not be a GCC 3.5 created by someone else. Can't think of any reason to, really.

      From GCC 3.3 onward, almost all development of GCC was centered around the tree-ssa project (the new optimization framework for GCC 4.0) and even though bits were in GCC 3.4 (unit-at-a-time for example), there really isn't any major new functionality in GCC 4.0 that is easily backported to GCC 3.4 that would suddenly make it different enough to call it GCC 3.5

      And even new major functionality doesn't mean one has to give a new GCC its own version number. If you look at the SUSE compilers from SUSE 9.0 and later (based on the hammer branch), they claim to be GC 3.3 based, but they're more like GCC 3.4 without the new C++ front end.

      RedHat had to do gcc-2.96 because GCC 3.0 was so awfully overdue and they had customer contracts to satisfy. They gave it a new version number because the C++ ABI it implemented had changed from 2.95. The problem was that the ABI was also not the same as the one implemented for GCC 3.0. That basically caused all other linux distribition to be binary incompatible with RedHat. That caused some hard feelings...

  3. Re:GOT IT! by neil.pearce · · Score: 4, Informative

    by default, gcc (with a .c or lang-spec set to c)
    let's you forget the #include, and the missing return value

  4. I don't get it... by ameoba · · Score: 3, Funny
    He claims to be running AMD64 Gentoo on a P4.

    Tycho (Homebrew)
    Dual Boot: Windows XP Professional
    Gentoo AMD64 GNU/Linux, kernel 2.6 SMP
    2.8GHz Pentium 4 w/HT, Intel D850EMV2, 533MHz FSB
    2x80GB Maxtor D740X 7200 RPM ATA-100 HD
    512MB PC800 RDRAM
    Radeon 9200 Pro, 128MB, NEC FE990


    That doesn't seem right; I know that Gentoo is able to adapt itself to your hardware, but this is a bit much for me to swallow.
    --
    my sig's at the bottom of the page.
    1. Re:I don't get it... by ChaoticCoyote · · Score: 4, Informative

      It's called a "typo". Fixed.

  5. Binary size by Guidlib · · Score: 3, Interesting

    Interesting that ICC seems to create consistently quite large binaries in comparison to GCC.

    1. Re:Binary size by multipart · · Score: 4, Informative

      This mostly comes from specializing loops and jumps. ICC does aggressive loop versioning (even including runtime CPUID checks) and, especially with profile feedback (not tested in this benchmark, unfortunately) ICC will try aggressively to try cheap alternatives before trying the generic approach. Think about expensive instructions such as divides and indirect jumpes here. GCC doesn't do that.

    2. Re:Binary size by Xabraxas · · Score: 3, Insightful
      Yeah... and faster code most of the time, too, in spite of it. Memory is cheap these days (512M DDR400 = $73, 80G HDD = $50).

      Who cares about memory when hard drives are so slow? Reading from laptop HDs is especially painful and binary size does come into play.

      --
      Time makes more converts than reason
  6. Performance isn't everything. by acceleriter · · Score: 5, Insightful

    Even if the Intel compiler is faster, it's best not to get in the habit of becoming locked into any proprietary platform. How likely is it that features on which one could come to depend will be kept available on free platforms, much less future processors not made or controlled by Intel?

    --

    CEE5210S The signal SIGHUP was received.

    1. Re:Performance isn't everything. by tetromino · · Score: 3, Informative

      it's best not to get in the habit of becoming locked into any proprietary platform. How likely is it that features on which one could come to depend will be kept available on free platforms
      And how likely is GCC to continue supporting the features you love? In case you haven't been checking, gcc-3.4 has removed some of its extensions to C grammar (the old joke used to go that gcc can accept a perl script as valid input). I use Gentoo, and after gcc-3.4 was released, I frequently encountered programs that refused to compile with 3.4. If anything, proprietary software (especially Microsoft's) tends to emphasize backwards compatibility over all other considerations.

      If gcc-4.0 makes your source unusable, will you patch the compiler? How long do you think it will take you to familiarize yourself with the source enough to figure out where the undesirable changes were made?

    2. Re:Performance isn't everything. by Screaming+Lunatic · · Score: 5, Insightful
      Even if the Intel compiler is faster, it's best not to get in the habit of becoming locked into any proprietary platform.

      That is why it is important to compile your code using multiple compilers. Prefer to write code to the C/C++ standards rather than to a particular compiler's idiosyncracies, GCC included. Different compilers also emit different warnings, helping one find bugs sooner.

    3. Re:Performance isn't everything. by fitten · · Score: 3, Interesting

      Different compilers also emit different warnings, helping one find bugs sooner.


      You can say that again. We had a bug recently in some code that gcc compiled without any warnings or problems but the code didn't work right. Compiled it with another compiler and got a warning in the code, looked at it, and sure enough, that was a legitimate bug. Corrected that line of C, recompiled on that compiler and gcc and both executables worked.

    4. Re:Performance isn't everything. by ky11x · · Score: 3, Informative

      Not true at all. Every compiler has specific extensions that are not implemented in other compilers, and they are support different parts of the standard with different levels of compliance. Template support for C++, for example, is different on every compiler, so there is a lot of cost in switching compilers if you have a large codebase.

    5. Re:Performance isn't everything. by smcdow · · Score: 3, Insightful

      Prefer to write code to the C/C++ standards rather than to a particular compiler's idiosyncracies, GCC included.

      Nonsense. GCC has way too many extremely useful "idiosyncracies" to abandon. If you don't know what they are, then you aren't paying attention.

      Better that other compiler makers mimic GCC's behavior. Better still is for the standards groups to adopt GCC as the reference standard for C and C++ compilers.

      --
      In the course of every project, it will become necessary to shoot the scientists and begin production.
  7. I am dissapointed in Intel by Billly+Gates · · Score: 4, Interesting

    I hear people complain about gnu C++ alot because its not as good as commercial compilers.

    However from what I see is the performance of the compiled code is the same with the exception that the resulting binaries are alot bigger.

    Maybe gcc is good on x86 but sucks on other architectures? I know the Sun and SGI geeks have complained for years that gcc does not run well on their platforms compared to expensive alternatives by their vendors.

    Has anyone run ICC and VC++.net on Windows? How does it compare to Borland and MS compilers under Windows2k?

  8. Vectorization? by r6144 · · Score: 4, Interesting
    On some numerical tests icc seems to give twice faster code than gcc, and I think it is probably due to icc's automatic vectorization (the difference in almabench is said to be mainly due to the superior software SSE-based sin() and cos() functions used by ICC, correct me if this is wrong).

    I think the author had better mark the tests whose inner loops have been vectorized, since while some algorithms are easily vectorizable, some are not, so the performance of both are interesting. After all, we care most about the features (such as automatic vectorization) of the compiler, while benchmarks only very roughly reflect the existence of such features, the applicability of them, and their effects.

    1. Re:Vectorization? by ChaoticCoyote · · Score: 5, Informative

      GCC 4.0 (which is, of course, "in development") has recently included automatic vectorization -- another of the "good things" that will be coming with the new architecture.

      My next article will compare automatic vectorization and profiled optimizations.

  9. Re:apples and oranges by PhrostyMcByte · · Score: 3, Informative

    ICC7 would compile to MMX/SSE that works on Athlon XP's just fine, but they changed that in v8 so it'll die on any non-Intel cpus.

  10. Re:I don't get it... that you don't get it... by Coryoth · · Score: 3, Informative

    For the people here not getting his point:

    AMD64 kernel
    Intel P4 processor

    Sure you can compile for AMD64 for if you like, but if your processor is an ordinary Intel Pentium 4 you probably won't be getting many benefits from doing so.

    As some of the more insightful people have pointed out, there is a difference between mcpu=x86-64 which will make optimaztions assuming amd64 architecture (which is just silly, as you'll get no gains from it on a Pentium chip), and march=x86-64 which breaks binary compatability and just won't run on a Pentium.

    So, either he's stupid and optimized for a CPU he doesn't have, or he is horribly incorrect about that configuration he specified, because it wouldn't be running. Take you pick.

    I hope that clarifies things.

    Jedidiah.

  11. Re:apples and oranges by Jeff+DeMaagd · · Score: 3, Interesting

    Are there any figures as to what proportion of Linux computers are x86?

  12. Re:Not a lot of selection for Linux compilers, eh? by tomstdenis · · Score: 5, Insightful

    Actually there are. LCC and TinyC come to mind. They're not used much in production [well LCC was reborn as LCC-Win32 for a while] but really GCC is the better choice.

    The problem with the "good old days" was that as my friend Dave Dunfield said once "C compilers are a dime a dozen".

    Just because you had a dozen C compilers for your 8086 doesn't mean you were better off. In fact most compilers for the 86 were crap [e.g. smallC, byteC, Zortech, paradise, etc...]. In fact the only half-way decent 86 compilers I recall are Turbo C [v3.01 was ok] and Micro-C [by Dave Dunfield so maybe I'm a bit biased there...].

    Note I'm not saying more compilers is bad. The problem is like any field "new" doesn't imply better. You have to tackle problems and answer them.

    For instance, GCC is rather large and can be slow/memhog on some files [C++ in particular]. A viable competitor for Linux would be one which optimizes decently while not being such a hog. It could pitch in when you can't build a file [say from VisualBoyAdvance which requires ~1GB of ram to build with GCC 3.4.2]...

    For the most part though, contributing to GCC makes more sense than writing your own compiler. First off, GCC is a "standard". So you're likely to get a huge audience that way. Second, GCC is already well established. It's a very good suite of tools and frankly hard to compete with. Third, you'll save a lot of time.

    For all intents and purposes you could change your argument to why do "linux" boxes only run the Linux kernel? I mean for all intents and purposes you could write your own kernel that was interoperable and use instead. For the same reason why contributing to GCC is a good idea so is contributing to the kernel [instead of writing your own] is a good idea.

    One last caveat before I send this post. I do agree though that writing such said tools [kernels or compilers in this case] are a good idea for educational purposes. It means a lot to know how to write a functional [and ideally half-way decent] compiler even if it only targets one platform and covers only part of a language. :-)

    phew...

    Tom

    --
    Someday, I'll have a real sig.
  13. This guy must be a nerd... by Isldeur · · Score: 5, Funny


    You can tell this guy is a nerd, but it goes far beyond the pizza and mountain dew... Is that really an empty tub of frosting sitting my his computer?? :)

    1. Re:This guy must be a nerd... by ChaoticCoyote · · Score: 5, Funny

      Yes, it is frosting. Chocolate frosting. How else can I maintain my svelt figure?

    2. Re:This guy must be a nerd... by ChaoticCoyote · · Score: 3, Insightful

      Wolfram has some interesting points, but I think his ego has gotten in the way of good science. With his "New Kind of Science", Wolfram hasn't really "invented" anything; he's mostly implying meaning where it may or may not exist.

      On the other hand, I do believe that higher order derives from basic, simple, underlying processes that combine in great complexity. Turning that supposition into real science is something I hope to see happen in the next century.

  14. Re:illogical hostility? by ChaoticCoyote · · Score: 4, Insightful

    The hostility mystifies me. I'm a semi-active participant in the GCC mailing list, and the people who work on GCC are very helpful, open, and communicative. Some even thank me for my QA efforts.

    I don't see that my article is negative about GCC; in fact, I'm very clear that Intel's compiler isn't a replacement for GCC, and that GCC is a fine product. Maybe the complainers can't read?

  15. commercial thinking by foog · · Score: 3, Informative

    The article seems to be rather narrowly from a computer hobbyists' point of view.

    It fails to point out that compile times are a fairly critical factor in programmer productivity. Yes, we should care that compile times with the Intel compilers look to be over 25% shorter than with gcc on average. (very rough eyeball estimate)

    I am amused, also, at how perplexed the author seems that IBM would ship Eclipse 2.x (and CDT 1.x, its associated C/C++ plugins) with the compiler. The CDT plug-ins for Eclipse 3.x were only ready a couple of months ago, so this is plainly a matter of how much time and money the Intel team had to test them with ICC. Or maybe they weren't available yet at all: when WAS the Intel 8.1 compiler released, anyway?

  16. Re:ProPolice by DrSkwid · · Score: 4, Interesting

    The OpenBSD team use it, and I think they know better than you or I.

    Not by technical choice, they want to use plan9's C compiler but have licence quibbles.

    Quoting Theo : "in particular we were interested in the c compiler"

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
  17. C/C++ vs. Fortran by Aardpig · · Score: 4, Interesting

    I find it interesting that there are only two C/C++ compilers available for Linux, as compared with seven Fortran 90/95 compilers (soon to be eight with the release of GCC 4.0). This not only dispels the myth that Fortran is a dead language, it also suggests that there is much more of a competitive market in compiling numerical code, than in producing other types of software.

    --
    Tubal-Cain smokes the white owl.
    1. Re:C/C++ vs. Fortran by Too+Much+Noise · · Score: 4, Informative

      Who said there are only 2 compilers? He only tested 2, that's all. Here's a bit of a list - and notice that some of these are targeted specifically to scientific computing:

      1. GCC
      2. Intel compiler (Intel only)
      3. Comeau
      4. PathScale (Opteron only)
      5. Portland Group (PGI)
      6. Borland

  18. Re:Not a lot of selection for Linux compilers, eh? by Jollyeugene · · Score: 5, Interesting
    Other compilers for Linux (Try google before you troll):

    TCC (tiny c compiler).
    Compaq Alpha C compiler.
    OpenWatcom C/C++ compiler
    TenDra C/C++ compiler
    egcs compiler (which merged into gcc- they saw that it had some advantages.)
    ChEmbeddable
    Cint c/c++ interpreter (not exactly a compiler)
    CC65 Commodore C compiler
    Absoft C/C++ Fortran compiler
    lcc

    These all run on linux. Some are open, some are not. GCC is used mainly because it is portable to just about anything-- so there goes your argument of GCC restricting choice. GCC exists to promote choice, and it does this.

    Take your code written for Visual Studio and compile it on Sun. Can't do that with Visual Studio? No MFC on Sun? Your best bet will probably be good old GCC with WINE. So how are you restricted by gcc?

    Now, if you want to make a cross compiler to compete with gcc- one with seperate front ends and back ends, so it can accept multiple languages, and can compile to just about every machine on earth-- then nothing is stopping you. Oh, what is that? Not interested. Neither is anyone else. Programers see no need to duplicate something that has been done well the first time. One good cross compiler is enough- GCC represents a NATURAL MONOPOLY.

  19. The even-odd thing... by devphil · · Score: 4, Informative


    ...does not apply to GCC. Never has. And it will not in the future, unless we radically change the way we do development and releases.

    3.4 follows 3.3 follows 3.2, and none of them were singled out as "developmental" or "experimentalal" or "extra stable". The experimental-vs-stable changes all take place before any release branch is made. There's more info on the website if you want.

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  20. gcc 3.4 still a little unreliable by kanly · · Score: 3, Informative

    I've been developing in C++ with gcc 3.3 for some time, and just moved to 3.4 for some testing. Thank god for unit tests. There's some bitop-heavy code that gets miscompiled with full optimization (-O2). In the process of trying to debug these (I'm not prepared to assume that they're the compiler's fault, it could certainly be my code invoking implementation-defined behavior,) I managed to get the compiler to choke with the -fschedule-insns flag with 'no free register' errors.

    In short, I don't have much confidence in the optimizer in 3.4. I'm trying to condense the problem to a testcase right now to submit a bug report.

    1. Re:gcc 3.4 still a little unreliable by kanly · · Score: 3, Informative

      If you're not prepared to assume it's a compiler problem, then why do say your code "gets miscompiled"? That sure reads like an accusation, which you acknowledge as being unfounded in the next sentence.

      OK, let's try this again. I'll type more slowly, so you can understand.

      The code is fairly complicated. It passes unit tests under 3.3 regardless of options. Under 3.4 without optimization it works fine, but when I use -O2 it behaves differently. Either my code is broken in a subtle way that only manifests under 3.4 with optimization, or the 3.4 optimizer is doing something naughty. I don't know which yet. Either way, I'm warning people that the 3.4 optimizer may treat code differently than 3.3 did. That's not an accusation.

      In the process of trying out different compile options to see if I could get a better idea of what was going on, I managed to get the compiler to bomb out completely and fail to generate any executable at all, with errors that appeared to be the optimizer finding itself unable to find enough registers. IMHO, that justifies some suspicion about the compiler's code generation.

  21. Re:Interesting image. by ChaoticCoyote · · Score: 3, Funny

    Coke goes better with rum.

    Well, that's my opinion. My wife insists that Diet Pepsi (ugh!) is a better mixer, but then, her sanity is in question given that she married me.

  22. LLVM and C++ by pb · · Score: 3, Interesting

    Another thing to try--LLVM can use g++ as a front-end to compile C++, and can often do further optimizations to speed things up even more. LLVM also has a C back-end, so you can benchmark other C compilers against each other too!

    Of course, the real fun will begin when it has completed Java and C# front-ends. :)

    --
    pb Reply or e-mail; don't vaguely moderate.
  23. GCC usually whips ICC for me by Baudelaire76 · · Score: 3, Interesting

    I'm always perplexed by such comparisons. Specifically, everyone talks about how awesome ICC is for numerical stuff. Well, I have written a fair amount of C++ code for computational fluid dynamics, and, for my code, GCC has always beaten ICC by a fairly wide margin (typically, 50 percent or more). Perhaps it has something to do with the fact that my code makes heavy use of templates? I don't really know.

    Also, in my experience, the C++ standard library that shipped with the previous versions of ICC just wasn't that good. Well, that may be a little harsh, but it was a source of considerable irritation to me that ICC's implementation of valarray did not even use expression templates (hello temporaries!). Yes, I know valarray isn't all that, but it is standard C++ (hence, in principle, code that uses it is portable). Once again, the GCC implementation was very much superior. This may be part of the reason why ICC now uses GCC headers.

    (As an aside, I did roll my own implementation of valarray that uses expression templates. I tested it with both GCC and ICC, and GCC still won.)

    I am now curious to test whether things are indeed better with ICC 8.1 (the last version I tested was 8.0). Maybe this time it will actually speed my code up rather than slow it down.

  24. Re:I don't get it... that you don't get it... by Jameth · · Score: 3, Informative

    Or, more specifically, you didn't think to check the facts of the parent post before assuming the author of the article was either stupid or horribly incorrect.

    If you had actually read the article, you would have seen:

    Corwin (Homebrew)
    Gentoo AMD64 GNU/Linux, kernel 2.6 SMP
    Dual Opteron 240, Tyan K8W 2885
    120GB Maxtor 7200 RPM ATA-133 HD
    2GB PC2700 DRAM
    Radeon 9200 Pro, 128MB, HP f1903 DFP

    Tycho (Homebrew)
    Dual Boot: Windows XP Professional
    Gentoo x86 GNU/Linux, kernel 2.6 SMP
    2.8GHz Pentium 4 w/HT, Intel D850EMV2, 533MHz FSB
    2x80GB Maxtor D740X 7200 RPM ATA-100 HD
    512MB PC800 RDRAM
    Radeon 9200 Pro, 128MB, NEC FE990

  25. Re:illogical hostility? by JoeBuck · · Score: 5, Informative

    The complainers can't read. I'm a member of the GCC steering committee, and I'm very happy with Scott's work (sorry, dude, I'm not going to call you "ChaoticCoyote"). It's not perfect, but it has helped to improve GCC.

  26. A few editorial notes. by jbn-o · · Score: 3, Informative

    Quoting the article:

    GCC is, of course, released under the GNU Public License, and I own a commercial license for the Intel compiler.

    Actually, the name of the license is the GNU General Public License. It is "General" because when the GNU project began there was no single license used throughout the project; .

    [...] while GCC has not quite reached the performance of its commercial competitor [...]

    GCC can be commercial too -- many firms distribute copies of GCC for a fee. I believe the author should have said "proprietary" meaning that what the Intel compiler program does, exactly, is secret. As RMS said when describing a proprietary web video streaming application he didn't want MIT to use to distribute a feed of his talk on copyright and globalization:

    "What it does is secret. You can't study it; you can't change it; and you certainly can't publish it in your own modified version. And those are among the freedoms that are essential in the definition of "free software."

    GCC, by contrast, is free software licensed under the GNU General Public License. Getting back to the article:

    These "coyote" benchmarks provide an excellent example of the advantages of "open" software development.

    Here I don't think "open" was the best choice of words, I think "free" would have been more accurate. The GNU Compiler Collection was originally the GNU C Compiler and first written by RMS. I guarantee you that RMS did not and does not now do work for the open source movement. He makes effort to make that point clear (like when he corrected Mike Uretsky who made the same mistake). The FSF asks you not to lump their work in with the work of the open source movement. Eben Moglen spoke at Harvard some months ago and also made this distinction. Prof. Moglen makes it clear why they are so adamant on this point:

    "We need to keep reminding people that what's at stake here is free speech. We need to keep reminding people that what we're doing is trying to keep the freedom of ideas in the 21st century, in a world where there are guys with little paste-it labels with price tags on it who would stick it on every idea on earth if it would make value for the shareholders. And what we have to do is to continue to reinforce the recognition that free speech in a technological society means technological free speech. I think we can do that. I think that's a deliverable message."

    I don't think he's overstating the case.

    Finally, there's a common misunderstood myth repeated in the end of the article:

    "Choice" is the key word here -- choice is good, be it in democracy or software. Intel provides a useful alternative to GCC for development on ia32 systems. One compiler might have a great environment for developing GUI code; another compiler might generate fast code. GPL-like freedom may be important -- or not -- as individual circumstances dictate.

    Many people believe this, I've even heard a variant of this myth being repeated by a representative of the Mozilla Foundation. Choice is no substitute for software freedom, in fact they speak to different aims entirely and in computer software choice is not as important as software freedom. If all we have are three web browsers to choose from (say, Microsoft Internet Explorer, Netscape, and Opera) choice is satisfied. B

  27. Silly gcc optimizations by 0x0d0a · · Score: 3, Interesting

    I was empirically analyzing the gcc 3.3.3 optimizer a couple of days ago. Some interesting points:

    [argh...lameness filter refuses to allow source code]

    I'm providing a link to my journal entry so that I can post these examples.

  28. Re:apples and oranges by Anonymous Coward · · Score: 4, Informative

    This isn't true: V8.0 works fine on Athlons.

  29. 1983 called.... by tundog · · Score: 3, Funny


    1983 called and it wants its programming language back.....

    --
    All your base are belong to us!