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."

379 comments

  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 multipart · · Score: 2

      Sorry but... ProPolice sucks.

      Nobody cares about stack smashing protection anymore these days. Besides, 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.

      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.

      And you might want to try IceCream instead of distcc. It's pretty, it's fast, it's hetrogeneously mutliplatform, and it's free software too.

    3. 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.

    4. 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.
    5. Re:gcc! by LiENUS · · Score: 0, Flamebait

      troll much? http://icecream.sourceforge.net/ that the icecream your talking about? looks like a shoutcast client

    6. 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.

    7. Re:gcc! by Billly+Gates · · Score: 2, Informative

      Well unless the benchmark is not good, the icc was not faster than gcc and was slightly slower and had much larger binaries.

      I was supprised to see that.

      Maybe on a risc platform I could see buying a proprietary compiler.

    8. 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.

    9. Re:gcc! by niteice · · Score: 2, Funny

      In Soviet Russia, GCC compiles YOU! (obligatory)

      --
      ROMANES EUNT DOMUS
    10. Re:gcc! by E_elven · · Score: 1, Insightful

      Of course the test was run on an AMD 64, so Intel may not be showing its best.

      I personally use Icc for the compile-time diagnostics and warnings, which usually clarify the errors from GCC, and frequently show undetected ones.

      --
      Marxist evolution is just N generations away!
    11. Re:gcc! by Anonymous Coward · · Score: 0

      Er, Gentoo AMD 64, that is.

    12. Re:gcc! by vadim_t · · Score: 2, Interesting

      Definitely a troll.

      I googled a bit to take a look at this mudflap thing. While it looks interesting, the system looks considerably more complicated than -fstack-protector and should be noticeably slower too.

      If I understood correctly, -fstack-protector simply adds a guard value and checks it hasn't been overwritten. The performance overhead is minimal. On the other hand, mudflap does some rather intensive checking that involves things like lookup tables, which obviously has to take more time than checking if a the guard value is still what it should be.

      According to this PDF, mudflap can have a really high performance penalty in bad cases. The performance section is rather short though, so it's not very clear what gets slowed down the most.

    13. Re:gcc! by Anonymous Coward · · Score: 0

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

      I wish I could say the same for that of your grammar.

    14. Re:gcc! by Anonymous Coward · · Score: 0

      I'll take it you don't come to Slashdot for the articles, then.

    15. Re:gcc! by Jeff+DeMaagd · · Score: 1

      Agreed.

      As the test system was only a Northwood P4 running "Gentoo AMD64", I don't think this particular test can be used when considering such a computer.

      In terms of relatives, with a very expensive computer or some other constraints is worth paying money for the fastest software to go with it. I doubt the average Linux geek really cares to pay Intel's prices, whatever they might be, years ago it was hundreds of dollars for a single licence. I don't know if the pricing structure has changed to allow free hobbyist use. I suppose a hobbyist that chooses to use an AMD64 distribution on a Northwood CPU would tend to not make the most appropriate choices anyway.

    16. 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
    17. 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
    18. Re:gcc! by cymen · · Score: 1

      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

    19. Re:gcc! by cymen · · Score: 1

      Quoting author below:

      It's called a "typo". Fixed.

      My apologies.

    20. Re:gcc! by Anonymous Coward · · Score: 0

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

      "up there".

    21. Re:gcc! by Anonymous Coward · · Score: 0

      Another fucking dipshit who has no clue. Go read up on ProPolice and find out exactly what it is before your ass starts regurgitating from your mouth, ok?

    22. Re:gcc! by enthused+i+swear · · Score: 1

      I am guessing that the distcc build failed on glibc, and this can be caused by a few different things. Glibc includes a hardened USE flag because building gcc with a stack protector flag will cause the build to fail at a certain point, so the hardened flag removes the stack protector option from that part of the build. So make sure you're using the hardened version of glibc. It could also be that you're compiling across hardened and non-hardened gcc, as this will cause builds to fail. I have bootstrapped a few machines with distcc, so I am guessing it is one of those problems.

    23. Re:gcc! by Anonymous Coward · · Score: 1, Insightful

      How many "ultra high performance" applications you see running on x86 hardware?

      Only clusters, which are pretty high-end as far as high-end goes. But I'd bet dollars to donuts that they use GCC with them.

      After all, they are all Linux clusters. And especially PowerPC-based clusters Apple's compiler of choice is.... GCC.

      There is a reason for:
      flexibility, portability, compatability > speed.

      It's not just idealism, it's cold hard reality.

      It's the same reasons that Unix is still dominate platform in high-performance and high end stuff, and VMS and it's contemporaries are now just history.

      Hell even NT/W2k were suppose to be "unix-killers" but they didn't make a dent in Unix's core market. They just grew along with the PC desktop.

      The closest anything else comes to "unix killing" is Linux... A Unix clone.

      Face it, GCC is a industry standard for a reason. It'll be around long after ICC and friends are long gone or completely rewriten.

    24. Re:gcc! by Anonymous Coward · · Score: 0

      The most problems ProPolice has had is with
      bugs in gcc's code generation itself, since ProPolice exercises new code paths.

      As far as the gcc team not being interested, it's more a case of ProPolice's author, Etoh Hiroaki, not speaking very good english, and not being vocal about Propolice on the gcc ml.

    25. Re:gcc! by sql*kitten · · Score: 1

      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"

      Exactly. If it costs $x for a commercial compiler that gives better performance and $y for extra hardware to match that performance using the binary from the free compiler, then the ONLY thing on your mind should be "is $x $y?".

    26. Re:gcc! by Eminor · · Score: 1


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


      I concur. It is an excelent idea. However, I have found that for certain configurations it doesn't actually manage to distribute.

    27. 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.

    28. Re:gcc! by EmbeddedJanitor · · Score: 2, Informative

      Contrary to popular opinion, x86 only make up less than half of Linux machines. Most Linux devices are embedded systems running on ARM, MIPS, PowerPC etc which, I'm sure, the Intel compiler does not support.

      --
      Engineering is the art of compromise.
    29. Re:gcc! by hopethishelps · · Score: 1, Insightful
      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"

      A multi-million dollar supercomputer will not use 32-bit Intel processors, so you can't choose the Intel compiler anyway.

      For some other architecture, it's much less likely that a proprietary compiler will do better than the Gnu compilers. Most compilers have bugs. The Gnu compilers are well tested, as a result of their wide use over many years.

    30. 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

    31. 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.

    32. Re:gcc! by vadim_t · · Score: 1

      Well, I followed the instructions from this page, and from the looks of it, it *should* be supported. It explains how to use distcc during the bootstrap, too.

    33. Re:gcc! by Jedi+Alec · · Score: 1

      unless that hardware can also be used for other purposes than compiling, in which case $y, even when >= $x might still be the more interesting option.

      --

      People replying to my sig annoy me. That's why I change it all the time.
    34. 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.

    35. Re:gcc! by Anonymous Coward · · Score: 0

      ...there are also occaisions where proprietary software gets what I need done quicker and easier, so I'll use that.

      There are also occasions where smacking someone upside the head with a two-by-four gets the job done faster than attempting to reason with them, so I do that.

    36. Re:gcc! by Anonymous Coward · · Score: 0

      RTFA, Icc was only run on the P4 setup. He tested an AMD and an Intel system. Icc won't even run on AMD64.

    37. Re:gcc! by bit01 · · Score: 1

      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.

      Fair enough. But make sure you take into account all the costs and benefits of using proprietary software versus open source. Quick fixes often have long term costs.

      ---

      It's wrong that an intellectual property creator should not be rewarded for their work.
      It's equally wrong that an IP creator should be rewarded too many times for the one piece of work, for exactly the same reasons.
      Reform IP law and stop the M$/RIAA abuse.

    38. Re:gcc! by Anonymous Coward · · Score: 0

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

      "up there".

      "Its"

    39. Re:gcc! by Dan+Ost · · Score: 1

      Did you read the article? He had two computers: an AMD64 and a P4.
      He didn't even attempt to test ICC on the AMD, only on the P4 and
      he gave an excellent explanation as to why he didn't bother testing
      ICC on the AMD.

      --

      *sigh* back to work...
    40. Re:gcc! by Donny+Smith · · Score: 1

      Nonsense!

      First, it's not only the price but also ease of debugging, optimization, etc. Developers' time is more valuable that couple of CPUs that you think you could scam out by going freeware.

      Second, many commercial compilers allow redistribution of compiled code so you might have a single workstation with commercial compiler, get your binaries done there and then install the RPM on a 32 node cluster.

    41. Re:gcc! by Anonymous Coward · · Score: 0

      openbsd is totally behind the curve, the pax author showed that recently with his reply to theo's presentation- but whatever, either way openbsd uses propolice.

      hardened gentoo? Oops uses it too.

    42. Re:gcc! by Anonymous Coward · · Score: 0
      If you look at the current top500 you'll see that there's a Xeon machine in the top 5

      So 80% of the top 5 don't use Intel 32-bit processors. What's your point?

      Have you actually tried other platforms?...HP's beats GNU on Alpha, etc

      I don't know if the OP has, but I have used an Alpha box (at a major investment bank) and we used the Gnu compiler, because it was the best available. I think you're making up your "facts".

    43. Re:gcc! by E_elven · · Score: 1

      Both of his specs said 'Gentoo AMD64', an obvious typo. Geez.

      --
      Marxist evolution is just N generations away!
    44. Re:gcc! by Chess_the_cat · · Score: 1
      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.

      You have that backwards. If customers only considered the sticker price OSS would always win: it's free. The argument of the commercial vendors is that OSS costs more to maintain in the long run. You know; the "only if your time is worth nothing" argument.

      --
      Support the First Amendment. Read at -1
    45. Re:gcc! by bit01 · · Score: 1

      The argument of the commercial vendors is that OSS costs more to maintain in the long run.

      "Sticker price" was shorthand for the way that vendors do their damnedest to keep customers uninformed about both the short and long term costs of commercial software and the benefits of having access to source code. Like the way they try to get a customer emotionally committed before quoting the price. In other words, get the customer to do an incomplete evaluation and stack the deck in the commercial software's favour. People familiar with open source and freeware know better.

      All else else being equal, open source must, by definition, be at least as good as closed source for the customer since everything the customer can do with closed source they can do with open source but not vice versa.

      ---

      It's wrong that an intellectual property creator should not be rewarded for their work.
      It's equally wrong that an IP creator should be rewarded too many times for the one piece of work, for exactly the same reasons.
      Reform IP law and stop the M$/RIAA abuse.

    46. Re:gcc! by ChrisMaple · · Score: 1

      I read somewhere (don't know if it's true) that Intel's compiler is very good at finding code that can be parallelized and producing output that includes MMX/SSE/SSE2 instructions. This can give enormous speed boosts, usually far beyond what's available from loop unrolling.

      --
      Contribute to civilization: ari.aynrand.org/donate
    47. Re:gcc! by Anonymous Coward · · Score: 0

      "is $x $y?"

      I hate you PHP coders. All of you.

    48. Re:gcc! by jmole · · Score: 1

      In Soviet Russia, GCC segmentation faults YOU!

  2. Re:GOT IT! by Anonymous Coward · · Score: 0

    Not going to be returning an int with that first post then?

  3. 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 echeslack · · Score: 1

      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.

    3. Re:3.5 vs. 4.0 by -noefordeg- · · Score: 0, Redundant

      Probably like apache. You have 1.3.xx releases while at the same time 2.0.xx releases appeared.

      Bugfixes etc.

    4. Re:3.5 vs. 4.0 by multipart · · Score: 1

      Bull crap.

      There will be no GCC 3.5

      The next non-bugfix release will be GCC 4.0

    5. 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.
    6. Re:3.5 vs. 4.0 by MassacrE · · Score: 0

      3.5 is a dev series (odd minor version # = dev for most gnu software)

      So the following stable release would be either 3.6 or 4.0. My understanding is that the decision was made to call it 4.0 - although there are not a lot of user visible changes, the change to SSA and GIMPLE radically changed the internals.

    7. 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.

    8. Re:3.5 vs. 4.0 by ari_j · · Score: 1

      This raised a question in my mind, as well...

      Linux version numbers are a.b.c; a is the major version number, b is even for production kernels and odd for development kernels, and c is an incremental revision number.

      For even b, the development kernel whose new features will make it into a.b is numbered a.(b-1).

      What version will the development kernel for 3.0 be? 3.-1.c or 2.9.c (or possible 2.7.c if they go from 2.6 to 3.0)?

    9. Re:3.5 vs. 4.0 by Anonymous Coward · · Score: 0

      2.7.c, regardless of what they call the next one. For instance, 1.2 was the last stable before 2.0, and the development branch was called 1.3.

      That said, it's already announced that 2.7 might be a throwaway branch; AM's plans are to make it quite experimental, when he finally starts it.

    10. Re:3.5 vs. 4.0 by Ctrl-Z · · Score: 1

      That would be 2.x.c where x is odd. Just like before 2.0.

      Tim

      --
      www.timcoleman.com is a total waste of your time. Never go there.
    11. Re:3.5 vs. 4.0 by ari_j · · Score: 1

      I thought that the definite odd-b-is-development-and-even-b-is-stable came about with 2.3.

    12. 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.

    13. Re:3.5 vs. 4.0 by j-pimp · · Score: 1

      Bull crap. There will be no GCC 3.5 The next non-bugfix release will be GCC 4.0
      I remember Redhat offering gcc-2.96 in redhat 7.0, a hybrid of 2.95/3.0 that had all sorts of increased C++ functionality that a C bigot like myself that treats his K&R manual like the king james bible will never understand. I'm sure history will repeat itself and someone else will make up a version 3.5. I swore off Redhat until Fedora came out because of all the sins against gcc redhat committed with 7.0.

      --
      --- Justin Dearing http://www.justaprogrammer.net/ We're just programmers.
    14. 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...

    15. Re:3.5 vs. 4.0 by LinuxGeek · · Score: 1

      After looking at this picture, I cannot doubt your hardcore hackerness at all. I have read your articles in DDJ dating back to 1989 or so and know you have great technical skillz...

      But when I saw that pic with the taco bell large cup, pepsi can hiding a liquor bottle and mostly empty cup of Betty Crocker chocolate frosting, I had to admit that you are probably a true hacker of RMS proportions.

      All joking aside, I have found your technical articles to be very useful; what things are you currently working on? I assume that this speed comparison between compilers has been research for another purpose.

      --

      Kindness is the language which the deaf can hear and the blind can see. - Mark Twain
    16. Re:3.5 vs. 4.0 by Fenris+Ulf · · Score: 1

      No, it started with 1.1.x.

    17. Re:3.5 vs. 4.0 by Anonymous Coward · · Score: 0

      The parent is a troll, although I see it has a high enough buzzword quotient to have fooled a number of moderators...

    18. Re:3.5 vs. 4.0 by Anonymous Coward · · Score: 0

      ... then you need to explain how it is a troll, to avoid being modded 'troll' yourself.

    19. Re:3.5 vs. 4.0 by Anonymous Coward · · Score: 0

      Firstly, the poster "FullMetalAlchemist" has a history of posting inflammatory anti-GNU comments: see for example this one ("I wish there were more Mozilla security flaws so that those annoying FSF/OSS brats shut up").

      Secondly, the post looks authentic but is in fact full of misinformation.

      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.

      SSA is indeed a standard optimisation technique. However, the fact that Tree-SSA is based on SSA does not mean it is automatically nothing new.

      SSA is just a method of representing code in a way which it is particularly easy for a machine to reason about. Of course the SSA representation is not interesting. The relevant question is what the compiler DOES WITH that representation. Asserting that Tree-SSA contains nothing new or worthwhile because it is based on an SSA representation, is like asserting that Linux 2.6 has no advantages over Linux 2.0 because both were written in C: it's an irrelevant detail.

      The reference to TenDRA is also a classic feature of anti-GCC trolls. Apparently the world would be a better place if GCC was based on TenDRA. Funnily enough, FullMetalAlchemist does not enlighten us as to why this is the case.

  4. 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

  5. Very informative. by mind21_98 · · Score: 1, Interesting

    Not bad. Not bad at all. Hopefully this will indeed spur development and add some competition to the otherwise small compiler market. :)

  6. Re:GOT IT! by neil.pearce · · Score: 0, Redundant

    see above secondary post...

  7. 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 drinkypoo · · Score: 1

      That is interesting, but it depends on the level of optimization. You can optimize for AMD64 but still run on i386, or you can compile for AMD64 and it won't run anywhere else. At least, that's how it works for other x86-compatible processors, not sure if that's how AMD64 is handled or not.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    2. Re:I don't get it... by slavemowgli · · Score: 0

      Why?

      --
      quidquid latine dictum sit altum videtur.
    3. Re:I don't get it... by Anonymous Coward · · Score: 0

      I really tried, but I still can't see your point. What is it? I don't see anything in the hardware list that would make it somehow incompatible with Gentoo. Was that your point? WTF?

    4. Re:I don't get it... by nbert · · Score: 1

      you are talking about mcpu=x and march=x mcpu will optimize the code for x whereas march will use every feature x provides (breaking backwards-compatibility).

    5. Re:I don't get it... by Liam · · Score: 1

      I think his point is the following:
      Gentoo AMD64 GNU/Linux, kernel 2.6 SMP
      ^^^^^ appears to compiled for an AMD processor
      2.8GHz Pentium 4 w/HT, Intel D850EMV2, 533MHz FSB
      ^^^^^^^^^ Appears to be Intel hardware
      My guess is the article author made a typo and accidentally copied the Gentoo configuration from his other box, which is running AMD hardware (Opteron).

      --
      Liam Healy
    6. Re:I don't get it... by ChaoticCoyote · · Score: 4, Informative

      It's called a "typo". Fixed.

    7. Re:I don't get it... by shird · · Score: 1

      A typo is a mistyped character here or there. This is a mistake, not a typo, theres a bit of a difference.

      So its not called a "typo" at all, but I suppose you'll claim that was a typo as well.

      --
      I.O.U One Sig.
    8. Re:I don't get it... by Anonymous Coward · · Score: 0

      Thank you Captain Anal for protecting the internet from evil characters such as this.

    9. Re:I don't get it... by Anonymous Coward · · Score: 0

      Although technically you are right, you are also wrong. I've seen this usage of the word "typo" online for a couple years now... any simple typing mistake beyond just screwing up a word's spelling (copy & paste in the computer world is definitely part of "typing") has been referred to as a "typo".

      Sure, it's not correct... but it will become so once the dictionaries begin to reflect this new usage of the word.

    10. Re:I don't get it... by strider44 · · Score: 2, Insightful

      So let me get this straight. You are attacking the writer for saying that that is a typo instead of a mistake? You, sir, are pedantic.

      But let me for a second play your game.

      Technically, by dictionary, a typo is "An error while inputting text via keyboard, made despite the fact that the user knows exactly what to type in. This usually results from the operator's inexperience at keyboarding, rushing, not paying attention, or carelessness."
      This means that should you accidentely type something totally different by habit or just thinking of something else, this will also classify as a typo under the definition of the world, for example typing "Gentoo AMD64" instead of "Gentoo x86" because he was copying the same format as above.

      Unfortunately you have just assumed that he made a mistake, that he literally thought that he had the AMD64 version installed on his computer, and thought "I knew there was something wrong with that", or he thought that Pentiums were a special class of Athalon 64. That would be classed as a mistake.

      Don't you know what they say about assuming: "don't assume or you'll make an arsehole out of yourself", or something like that. I say similar things about being pedantic as well.

    11. Re:I don't get it... by Anonymous Coward · · Score: 0

      It's spelled "Athlon."

    12. Re:I don't get it... by civilizedINTENSITY · · Score: 1

      So let me get this straight. You are attacking the writer for saying that that is a typo instead of a mistake?

      Uh, if you look, you'll see that the parent and the writer are the same person . But thanks for playing, and nice score despite your confusion.

    13. Re:I don't get it... by strider44 · · Score: 1

      I'm sorry, it was a typo

    14. Re:I don't get it... by strider44 · · Score: 1

      perhaps you should look a little closer, and you'll see the grandparent is the author of the article.

    15. Re:I don't get it... by Felonious+Ham · · Score: 1
      Technically speaking, it's "When you assume, you make an ass out of 'u' and 'me'". I'm assuming that "arsehole" is a typo.

      No thanks needed,

      Todd

  8. Great article. by Anonymous Coward · · Score: 0

    I don't have much to add but wanted to say thanks for an interesting read.

  9. Re:GOT IT! by acceleriter · · Score: 1

    Learn something every day--thanks :).

    --

    CEE5210S The signal SIGHUP was received.

  10. apples and oranges by benasselstine · · Score: 2

    Does the Intel compiler support any other chip architectures other than Intel architectures?
    Hmm?

    --
    My other car is a slashdot UID.
    1. Re:apples and oranges by multipart · · Score: 1

      Depends on how you look at it.

      If you consider AMD to be mere Intel architecture clones, then no it does not support other architecures.

      If you consider AMD64 as a new architecture, then yes ICC will support non-Intel architectures. Of course, assuming you agree that EM64T is a cheap (and rather inferior) clone of the AMD64 architecture.

    2. Re:apples and oranges by Sivar · · Score: 2, Funny

      Yes, of course.
      As you know, Intel is very eager to improve performance of processor architectures that are competing with their own.

      --
      Computer Science is no more about computers than astronomy is about telescopes. --E. W. Dijkstra
    3. 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.

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

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

    5. Re:apples and oranges by MonsterChicharo · · Score: 2, Insightful

      Unless you are targeting for binary compatibility among different architectures, the question is somewhat meningless. If you need to compile from the source, you may very well use a faster tool for the job; it can be Intel for Pentiums, and GCC for the rest.

      Granted, if you want to deliver a binary that runs on other platforms (by means of emulation or whatever) you better stick to GCC. Now, how many times do you need this?

      I believe the author of the article himself is stating that in the end you should be using the best tool for the job. So there.

    6. Re:apples and oranges by Unordained · · Score: 1

      ... which is why it'd be interesting to have teams from various CPU manufacturers helping software like GCC work better with their own products, with someone in charge of making sure they don't overstep their boundaries and suggest "improvements" in name only for other architectures (or at least make sure other teams are notified of anything relevant.)

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

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

    8. Re:apples and oranges by Anonymous Coward · · Score: 0

      ICC v8.0 supports MMX specific code
      ICC v8.1 DOES NOT support MMX specific code

      So, while v8.0 will work with Athlon XPs, the latest version v8.1 (and all subsequent versions) are going to produce slower code. But they won't break outright since they will still run unoptimized generic ia32 code.

  11. reverted by Satai · · Score: 2, Informative

    At work we (well, I admin and made the call) reverted from the 8 series of intel to the 7 series because of some issues with fortran 90 compilation, but I hadn't noticed the 8.1 release. I'll have to give it a shot...

  12. 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 Anonymous Coward · · Score: 0

      Yeah... and faster code most of the time, too, in spite of it. Memory is cheap these days (512M DDR400 = $73, 80G HDD = $50). As the other reply to this says, Intel does multiple things, including support for things like using SSE if you have it and defaulting to x87 if you don't.

    3. Re:Binary size by colinrichardday · · Score: 1

      Of course, CPU time is cheap, too.

    4. 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
    5. Re:Binary size by blane.bramble · · Score: 1

      Yeah... and faster code most of the time, too, in spite of it

      It's not faster in spite of it - it's because of it. As a general rule of optimisation, you can optimise for size, or for speed, but not both. Think of it this way, in any loop the loop test and jump both waste processor time. If you knew how many times the loop was going to be executed, you could just expand it out into n copies, avoiding a comparison and a jump. This would be faster, but the object code would be bigger.

    6. Re:Binary size by Jthon · · Score: 2, Insightful

      Maybe, or by expanding the loop you just induce a bunch of cache misses which hurt performance more than the couple extra instructions to check a loop variable. In today's world memory is an order of magnitude slower than today's processors. By not unwinding the loop you get the benefit of the temporal locality. Of course the n copies of the loop may be fetched in one memory access. It all comes down to how many blocks are fetched by the cache for a miss, vs size of the unwound loop. If all n copies are fetched in a miss you win. If it takes n memory accesses instead of 1, you lose.

    7. Re:Binary size by psetzer · · Score: 2, Interesting

      Don't underestimate the importance of a full pipeline. If you can avoid a bubble in the pipeline at any cost, odds are you would want to do so. That's one of the beauties of predication in a processor architecture. Although I'm sure that there's some way to make an instruction a whole frigging cache line long, that's more an exercise in perversity than a practical limitation if you don't unroll your loops too much. I could see a series of instructions being like that, though. If you're just adding an array of four numbers to another array of four numbers, then unrolling is the only sane choice. If it's two arrays of 100 numbers, then you should do some testing based on how big the instruction cache on your processor is. If it's a combined cache, then you might see a really substantial drop. As always, profile, profile, profile.

      --
      "Anyone who attempts to generate random numbers by deterministic means is living in a state of sin." -- John von Neumann
    8. Re:Binary size by Anonymous Coward · · Score: 0

      It's because, by default, it actually compiles multiple copies of important routines into each code. Which copy actually gets run is selected at run-time, based on the CPU running. This is so you can get peak performance out of a Pentium 2 with MMX and a Pentium 4 with SSE2 without having to recompile or distribute multiple binaries.

      You can turn this off. If you compile with -Os to disable optimizations that increase code size, you will get code as small as (or smaller!) than that which GCC can produce.

    9. Re:Binary size by 6800 · · Score: 1

      It would be interesting to see the bm run again with this 'de-optimization' and note size again as well as speed. It would also be interesting to optimize the gcc for speed and less for size, again noting both size and run times. After both exercises, we would have a better feel for the peanuts to peanuts comparison instead of just nuts to nuts :-).

    10. Re:Binary size by saigon_from_europe · · Score: 1

      We are lucky! Once when Kingston starts to make compilers, binaries will be even bigger...

      --
      No sig today.
    11. Re:Binary size by IamTheRealMike · · Score: 2, Insightful
      Memory may be cheap but the increased performance gained from optimizing for code size isn't negligable.

      In particular small code can make apps start faster, and the whole computer feel more responsive. The day computers never swap and disk I/O isn't a bottleneck will be the day we can ignore code size in compiler benchmarks.

    12. Re:Binary size by JollyFinn · · Score: 1

      No it doesnot. Binary size means verylittle from loading it from HD.
      Consider this. 10ms latency from HD and 60MB bandwith. Latency takes 1/100th of a second and for 1MB binary the bandwith takes 1/60th of a second. If different compiler doubles the binary size it still won't produce anything that hits you hard compared to something like loading from 2 or more small configuration files during startup... Now if we have a 10MB binary its still far less than a second.
      Think. Loading binary if you have plenty of ram should take much less than a second, and start up just loads settings, data etc, or initializes things that takes time too and probably more than what you save from getting slightly bigger binary.

      --
      Emacs is good operating system, but it has one flaw: Its text editor could be better.
    13. Re:Binary size by pthisis · · Score: 1

      The day computers never swap and disk I/O isn't a bottleneck will be the day we can ignore code size in compiler benchmarks.

      Only once the L1 cache is the same size as RAM.

      --
      rage, rage against the dying of the light
    14. Re:Binary size by Xabraxas · · Score: 1

      You are forgetting libraries. Most of the time you are not just loading one binary into memory. You load the main program and all of its libraries, which can be very large in size. The difference between a 4200 RPM HD with 2 MB cache and a 7200 RPM HD with 8 MB cache is very large and the binary size DOES come into play.

      --
      Time makes more converts than reason
  13. 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 Guidlib · · Score: 2, Insightful

      I'm certain that if there was some quirk that seperated ICC from other compilers that you just loved abusing, that it still wouldn't be terribly hard to make the few changes required to move to another compiler down the track. That's the beauty of using a language like C. So long as you conform to the standards in your code, you should be fine wherever you go. It seems almost like scaremongering to make the suggestion in the parent post.

    2. Re:Performance isn't everything. by Anonymous Coward · · Score: 2, Insightful

      So when the purveyors of proprietary software engage in FUD against Free Software, that's marketing, but when OSS folks point out the drawbacks of imprisoned software, that's "scaremongering?"

    3. 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?

    4. Re:Performance isn't everything. by acceleriter · · Score: 1, Informative
      If gcc-4.0 makes your source unusable, will you patch the compiler?

      Maybe, maybe not. But while my chances of being able to fix gcc-4.0 may be infintessimal, they're infinitely higher than the (zero) chance of my being able to fix icc (legally).

      --

      CEE5210S The signal SIGHUP was received.

    5. Re:Performance isn't everything. by Guidlib · · Score: 1

      In this case, I don't see where the drawback could possibly be. I just can't imagine any way that any reasonable developer could lock him/herself into using ICC.

    6. Re:Performance isn't everything. by doomdog · · Score: 2, Insightful

      How is using an Intel compiler locking you into a proprietary platform? Well-written code can be run through any compiler -- your main cost in switching compilers is figuring out the correct command-line switches, since they're all different...

    7. Re:Performance isn't everything. by Wesley+Felter · · Score: 1

      So you just have to make a habit of compiling using both compilers. With more and more projects using Tinderbox-like auto-compilation, it's easy.

    8. 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.

    9. Re:Performance isn't everything. by Sentry21 · · Score: 1

      That being said, if your target audience is x86 systems anyway, ICC provides an alternative that can significantly (in some cases) boost performance.

      I think the key is to write good code first, then take advantage of the optimizations ICC provides second. Intel won't lock anyone in, but they'll put the lock on the door. Whether you close it behind yourself is your own choice.

      --Dan

    10. Re:Performance isn't everything. by tetromino · · Score: 1

      but while my chances of being able to fix gcc-4.0 may be infintessimal, they're infinitely higher than the (zero) chance of my being able to fix icc (legally)

      I suppose the chances of a pig spontaneously sprouting wings and rocket engines and flying to the moon are, technically, infinitely higher than zero...

    11. 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.

    12. Re:Performance isn't everything. by bob+beta · · Score: 1

      Part of good coding practice is to keep your code portable. That means your source should be written to build on different platforms, and with different compilers. Code to the ANSI standard.

      To rephrase what you said in your comment:

      "it's best not go get in the habit of becoming locked into any specific platform." Writing GCC-only code is just as bad as writing ICC-only code.

    13. Re:Performance isn't everything. by Anonymous Coward · · Score: 0

      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?

      I agree, using Intel's compiler allows you to take advantage of features such as export and two phase look up that aren't available on non-standards conforming compilers like GCC.

    14. Re:Performance isn't everything. by Xabraxas · · Score: 1

      It's called embrace and extend.

      --
      Time makes more converts than reason
    15. Re:Performance isn't everything. by Xabraxas · · Score: 1
      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.

      Bull. I use gcc 3.4 on Gentoo and have only encountered a few issues with it. Overall gcc 3.4 produces much better code than previous versions.

      --
      Time makes more converts than reason
    16. Re:Performance isn't everything. by Xabraxas · · Score: 1

      You say that like only gods can work on gcc. Believe it or not there are actually people out there that still know how to code. It seems like more and more people with little to no tech skills are joining the open source community but that doesn't mean that no knows how to code anymore. If you can't do it, you can hire someone who can. If icc breaks you're screwed, unless you have enough clout to sway intel.

      --
      Time makes more converts than reason
    17. Re:Performance isn't everything. by tetromino · · Score: 1

      I use gcc 3.4 on Gentoo and have only encountered a few issues with it
      Off the top of my head, I can count openoffice (fails with 3.4.any), iobench (failed with 3.4.1 on athlon-xp), arts (fails with 3.4.any hardened), kdelibs (failed with 3.4.1 hardened on athlon-xp), mozilla-1.7.2 (failed for me with 3.4.something), and gimp-2.0.2 (failed with gcc-3.4.1 hardened, I think).

      I am sure 3.4 produces better code, but it is more strict about the syntax it accepts, and before version 3.4.2, it was kinda flaky on some platforms.

    18. 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.

    19. Re:Performance isn't everything. by psetzer · · Score: 2, Insightful
      In any complex system, I'd doubt that even the gods could work on it. Some days to me, it seems that programming isn't a science, but a random walk. Some changes screw things up, and the program won't even run after they're implemented. Others make the whole program work quicker and more efficiently. What we do is get rid of the bad changes and add the good ones. Open source means in the long run that there will be more changes, but thankfully, if the people working on it care about the end product, then the program will get better quickly since the good changes will be kept and the bad ones culled.

      No matter how good you think you are, and you may be one of the best, for all I know, compile time optimizations are often truly hairy, and sometimes the implementer doesn't even understand why they work. There's an old trick about how to add two 64-bit numbers in a computer with 32-bit registers in only four instructions. You can tell it to anyone, but the important thing is 'do they understand it?' If not then it's of little to no use in a properly written program. Otherwise, it's a neat little assembly trick taking advantage of the fact that a fairly complex algorithm for the carry bit can be broken down into one instruction.

      Algorithms used to speed compiled code are much more complex than that one instruction. Changing them significantly without understanding them at all is stupid. You are lucky if it breaks cleanly. Otherwise, your fix may be around to haunt you for years to come.

      --
      "Anyone who attempts to generate random numbers by deterministic means is living in a state of sin." -- John von Neumann
    20. Re:Performance isn't everything. by reverius · · Score: 1

      what he meant by platform was processor architecture.

      writing gcc-only code on x86 is just as bad as writing icc-only code on x86, but if you want your program to run on sparc, or whatever, you'd be better off writing for gcc (assuming you have to write for a specific compiler)

      you're right, of course, about coding for the ansi standard. definitely a better idea.

    21. Re:Performance isn't everything. by Anonymous Coward · · Score: 0

      ...which is a great reason not to use templates. ;-)

    22. Re:Performance isn't everything. by Anonymous Coward · · Score: 0

      I think, as mentioned in the article, that for instance OpenMP is a good reason for using Intel's compiler. Of course, if you don't know what OpenMP is, chances are pretty high that you don't need it either.

    23. Re:Performance isn't everything. by Jedi+Alec · · Score: 1
      In any complex system, I'd doubt that even the gods could work on it. Some days to me, it seems that programming isn't a science, but a random walk. Some changes screw things up, and the program won't even run after they're implemented. Others make the whole program work quicker and more efficiently. What we do is get rid of the bad changes and add the good ones.

      Sounds like evolution to me...

      --

      People replying to my sig annoy me. That's why I change it all the time.
    24. Re:Performance isn't everything. by Xabraxas · · Score: 1

      I haven't compiled any of those programs except the gimp and it worked fine.

      --
      Time makes more converts than reason
    25. 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.
    26. Re:Performance isn't everything. by Dan+Ost · · Score: 1

      Always compile with -Wall to turn on all of gcc's warnings.
      Then, always fix warnings, even when you know it's nothing.

      This helps make code clearer and easier to maintain in the long
      run (and keeps you from missing a legitimate warning amidst a
      bunch of "safe" warnings).

      --

      *sigh* back to work...
    27. Re:Performance isn't everything. by stonecypher · · Score: 2, Informative

      That's funny: my templates, which are written to the C++ standard, work just fine under GCC, SCC, ICC, Comeau/EDG-based compilers like MSVC and BCC, and so on. Rather than make claims that things vary from compiler to compiler, why not show us some examples?

      --
      StoneCypher is Full of BS
    28. Re:Performance isn't everything. by bob+beta · · Score: 1

      Definitely. A good package should also build on NetBSD/vax, and even NetBSD/mac68k. There's nothing cooler than being able to run the current software on my old Mac SE/30 (and on an old Cassiopeia 'Palm PC' liberated from Windows CE).

    29. Re:Performance isn't everything. by Gopal.V · · Score: 1
      > 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.

      Very true, Try compiling Linux with ICC and we'll compare :) .. I have a program which runs 30% faster on GCC due to just one reason - Computed GOTO. Computed GOTO is sooo much faster than a switch loop for most performance intensive switches . You could use function pointers to achieve something similar, but method call overhead outweighs switch loop costs (where it would be inlined anyway).

      > 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.

      GCC rocks ... (sdcc's good too.. but it's a niche compiler).

      The good thing is that it's all very well documented. and of course you can refer the source (but not copy directly).
    30. Re:Performance isn't everything. by Anonymous Coward · · Score: 0

      So... you haven't tried the specific examples he was citing as cases where GCC 3.4's removal of deprecated extensions affected existing code? In that case, kindly retract your assessment of his problems as "bull". IT IS A FACT THAT GCC 3.4 REMOVED SOME EXTENSIONS. IT IS A FACT THAT CODE WHICH USED THOSE EXTENSIONS IS NOW BROKEN. THEREFORE, SAYING THAT GCC 3.4 BROKE SOME CODE IS NOT "BULL".

    31. Re:Performance isn't everything. by Anonymous Coward · · Score: 0

      It's called embrace and extend.

      But icc *doesn't* extend! It's gcc that has all the incompatible non-standard extensions! It's easy to transfer code developed on icc to gcc, but it's not as easy to transfer code developed on gcc to icc!

      Intel have embraced the C++ standard. GNU have extended it. Which of those approaches is more likely to lead to lock-in?

    32. Re:Performance isn't everything. by Xabraxas · · Score: 1
      But icc *doesn't* extend! It's gcc that has all the incompatible non-standard extensions! It's easy to transfer code developed on icc to gcc, but it's not as easy to transfer code developed on gcc to icc!

      Intel have embraced the C++ standard. GNU have extended it. Which of those approaches is more likely to lead to lock-in?

      You're missing the point. ICC is proprietary. If they choose to embrace and extend then there is nothing anyone can do about it. When GCC does it, anyone can copy the features if they please. There is no way that GCC can lock you in.

      --
      Time makes more converts than reason
    33. Re:Performance isn't everything. by Xabraxas · · Score: 1

      It is bull and I won't retract my statements. I have compiled the GIMP with GCC 3.4 and half of his examples concerned hardened GCC which probably had more of an effect on the compliation of those programs than which version of GCC was used. Until you or he can prove otherwise it is bull.

      --
      Time makes more converts than reason
    34. Re:Performance isn't everything. by jmv · · Score: 1

      I'll might start relying on those "extremely useful idiosyncracies" when the gcc team publically states that they will keep supporting them forever. Right now, most of them tend to be changed/removed without much notice (reprecated in the new version, then gone).

    35. Re:Performance isn't everything. by jmv · · Score: 1

      One example, the only MS compiler I've used (normally only gcc/Linux) was MSVC++ 6 and it didn't support partial specialization of templates. AFAIK, even gcc still doesn't have *all* corner cases right when it comes to templates.

    36. Re:Performance isn't everything. by Bert64 · · Score: 1

      Personally i always try to write portable code, which involves not using features which are broken/different on different compilers or os's...
      That way, anyone who wants to use your code is free to build and run it on whatever OS he chooses using whatever compiler he chooses...
      One program of mine for instance, builds on linux with gcc, icc or ccc (compaq's compiler), solaris with gcc and sun workshop, irix with gcc and mipspro, aix with gcc and ibm's compiler etc...

      --
      http://spamdecoy.net - free throwaway anonymous email - avoid spam!
  14. You can run intel binaries on opteron by DMC_DMC_DMC · · Score: 2, Informative

    32 bit intel binaries will run on an Opteron and will probably give some gain as seen here at Aces.
    Aces article

  15. Re:I don't get it... that you don't get it... by Anonymous Coward · · Score: 0

    I don't get what you don't get.

    I mean Linux was running on AMD64 natively since the very first day they started selling it. Suse specificly, but Gentoo soon followed.

    And you can compile 32bit on it if you realy want to ...

    Is it just because Windows XP-64 is overdue for a year now you don't think anybody else can do it or something?

    AMD needed a server OS to push the opteron platform and to take advantage of it's 65bit-ness. That was it's major advantage over Xeons...

    MS's OS design is monolythic, highly optimized for x86 platform and rigid, it makes for slow ports. However on the other hand Linux has run natively for years on various 64bit platforms and is very modular in design. Making porting a snap.

    Oh, and in case you guys go "Windows has run on 64bit platforms too!!", I know I know.

    NT ran on 64bit alpha, but in 32bit mode. W2k had a advanced beta that ran in 64bit native mode, basicly it compiled and booted, but that was about that. It has very little to do with the win32 stuff you use today in XP. Lately there are Windows servers versions for Intanium, but still nothing for the Opteron.

  16. Believe this? by TheUnknownOne · · Score: 1

    Im sorry, but in my mind anything this guy puts out is invalid. He is using a 64bit distrobution on a 32 bit chip? He is using something designed for an AMD64 chip on an Intel chip?

    1. Re:Believe this? by ChaoticCoyote · · Score: 2

      Ah! A typo! I cut-and-pasted the OS test, and forgot to change "AMD64" to "x86" for the Pentium 4. I just made the trivial edit.

  17. 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?

    1. Re:I am dissapointed in Intel by Anonymous Coward · · Score: 0

      I did some optimized run time comparison between Borland C++ Builder, VC++ 6.0 and Intel C++ 7.0 on Windows 2000 on image processing code about 2 years ago. Borland's output was the slowest one, MS's was about 10% faster and Intel's was another 10% faster.

    2. Re:I am dissapointed in Intel by Billly+Gates · · Score: 1

      So if ICC is as good on win32 than Linux, than gcc is not that bad at all as a compiler and Intel offers no real benefit on the Linux/BSD platforms.

      Perhaps if I ran unix on another platform I would consider a commercial compiler but it just seems silly to use ICC unless you need fortran 95 support which gcc lacks.

    3. Re:I am dissapointed in Intel by Code+Dark · · Score: 0

      Isn't the larger binary file/slower code just due to the fact that it's unoptomized? Many of these compilers include built-in optimization code... perhaps that's the difference.

      --
      - Code Dark
    4. Re:I am dissapointed in Intel by f16c · · Score: 1

      "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."

      Though this has changed recently, the reason some people prefer the GNU compilers was for reasons of stability and consistancy of the product. Sun's compilers were stated to me as being painful to work with and generated more headaches than code.

      --
      bob@Osprey:~>
    5. Re:I am dissapointed in Intel by pikine · · Score: 1
      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.

      I tried gcc 3.3.2 on Solaris. Most problems I've had so far have to deal with are header/library path problems. The reason, according to $(prefix)/lib/gcc-lib/$(platform)/$(gcc-version)/ include/README, is because "GCC requires ANSI C headers and many vendors supply ANSI-incompatible headers."

      Also, some programs compiled with gcc tends to segfault. I haven't found the exact reason, but those programs tend to be linking with more exotic libraries compiled using the vendor cc, so I think it's an ABI problem.

      --
      I once had a signature.
    6. Re:I am dissapointed in Intel by ndogg · · Score: 1

      Nah, GCC only sucks under Windows for x86, at least in my experience.

      --
      // file: mice.h
      #include "frickin_lasers.h"
    7. Re:I am dissapointed in Intel by javax · · Score: 1

      gcc works absolutely fine here on Darwin/PPC...

    8. Re:I am dissapointed in Intel by Baki · · Score: 1

      Hmm, I've been using apache, mysql and postgres binaries on Solaris for years (the last time compiled with gcc 3.0) and I have never seen a crash of neither of the programs.

    9. Re:I am dissapointed in Intel by Anonymous Coward · · Score: 0

      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.


      Yeah. Writing "a lot" is also "alot" bigger, but the question is: does it make it any less correct?

    10. Re:I am dissapointed in Intel by Anonymous Coward · · Score: 0

      It's very true. The MIPS R10000 optimizations were never added to gcc. For whatever reason the patch was ignored or denied. And I've measured 10-15% speedup on xmame for a MIPSpro compiled binary above a gcc binary. gcc is definitely not the way to go on SGI except for not needing an expensive license for it.

      For X86-64 people have been talking about this "pathscale" compiler that supposedly works in a gcc environment. I haven't tried it myself.

    11. Re:I am dissapointed in Intel by multipartmixed · · Score: 1

      I run 2.95.3 professionally under Solaris 8, and have been running the 2 series since 1997 with Solaris 2.5.1, 7/x86, and 8.

      We've played a bit with 3.x but it broke in a few places (__FUNCTION__), and we haven't had the time to go re-validate the enormous "tested correct" codebase. For us, correctness is more important than ANYTHING.

      Anyhow, your problem under the 2 series would be resolvable by running a special script which messes with the Solaris headers. I can't remember the name of the script, but it shipped with GCC2, and presumably three. Also, the packages from sunfreeware.com have always installed without problems, including the 3.2 package we installed on one of our testbed dev platforms (we want to leverage constant functions and a few other things in 3 someday, for a performance boost).

      > Also, some programs compiled with gcc tends to segfault.
      > I haven't found the exact reason,

      You're trying to dereference a pointer to a memory address which isn't yours. That's what segfault means.

      > I think it's an ABI problem.

      gdb programname corefile
      bt

      You'll know in two seconds flat if it's an ABI problem, because it'll be crashing in the middle of a system call.

      Of course, it probably isn't, since the function arguments and their behaviour are dictated by the code and the system libraries.

      GCC works VERY WELL (excluding raw speed) under Solaris. You must be doing something wrong.

      --

      Do daemons dream of electric sleep()?
    12. Re:I am dissapointed in Intel by pikine · · Score: 1

      So I was in a hurry to get this program to work, so I didn't investigate very far until I gave up and use the Solaris cc instead. But here are some details. It was gcc 3.3 with Solaris 2.6. The program was using ucontext fairly throughly (userland context switching). The same program worked under Solaris cc.

      As to your comment on segfault, if a program is correct, where can it get its bad pointer from? Misaligned struct members, of course. And this is not an ABI problem? You must be kidding me. And when you see the desired value is at an offset +4 than the location your program is peeking at (observed in gdb, of course), you know there is a problem.

      Allow me to refresh your terminology. ABI, Application Binary Interface, does not restrict itself to system calls. It refers to the binary encoding of data structures so both programs using the same data structure definition can understand each other at a binary level.

      To think back a bit more, it is probably some compiler #define differences that altered the definition in the ucontext.h header, and not necessarily due to ABI incompatibility either (since they wouldn't be using the same definition). I wouldn't be surprised if this is the case. But fixing that involves hacking the gcc spec file, which is not something I wanted to do in a hurry.

      Anyhow, I respect your choice of using gcc and defending it very passionately. However, my choice is ambivalent. I just use the right tool for the right job.

      --
      I once had a signature.
    13. Re:I am dissapointed in Intel by multipartmixed · · Score: 1

      > s to your comment on segfault, if a program is
      > correct, where can it get its bad pointer from?
      > Misaligned struct members, of course.

      No, that generates SIGBUS.

      Otherwise -- valid points.

      Oh wait, I see where you're coming from. You should n't be able to get misaligned struct members in that struct; GCC doesn't know anything special about it and pads per Solaris ABI -- not that it matters, since everything is pointer-sized, anyhow.

      I'd be more willing to bet that your software was doing an ifdef _GNUC_ and assuming something about the architecture it shouldn't have.

      --

      Do daemons dream of electric sleep()?
    14. Re:I am dissapointed in Intel by Anonymous Coward · · Score: 1, Insightful

      GCC only sucks under Windows for x86, at least in my experience.

      This is going to be an unpopular comment. But the problem isn't that GCC sucks, it's that MSVC is very good. GCC produces similar results on all x86 platforms. MSVC produces faster code on Windows. That is, the Microsoft product is simply better than the GNU product.

      Posted anonymously for reasons that should be obvious...

  18. ProPolice by Anonymous Coward · · Score: 0

    really only very few people truely believe it makes a difference.

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

    1. 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
    2. Re:ProPolice by Anonymous Coward · · Score: 0

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

      Isn't that how SCO got started?

    3. Re: Propolice by Anonymous Coward · · Score: 0

      DragonFly BSD uses Propolice by default as well.

  19. 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.

  20. [ot] Re:GOT IT! by Anonymous Coward · · Score: 0

    Still doesn't make it correct. You should #include for everything you use and always declare main() an int and return a value...

    Sure, I'm being picky, but meh, sue me.

  21. Not a lot of selection for Linux compilers, eh? by doomdog · · Score: 0, Flamebait

    The title of the piece is "Linux C and C++ Compilers", yet the only ones benchmarked are GCC (various versions) and Intel's 8.1 ICC. Aren't there any others out there???

    You know, it seems there were far more compilers available for DOS and OS/2 than are available for Linux. To me, this says that Open Source removes software choices from the consumer in the long run, which means that open source is not a good thing for the general software-consuming public. The ones that benefit from open source are those who don't want to pay for software...

    Future generations will look back on open source, curse us and wonder how we could have been so naive and self-centered as to actually promote it...

    1. Re:Not a lot of selection for Linux compilers, eh? by Wesley+Felter · · Score: 1

      Yes, I was hoping to see some PathScale results.

      It's important to remember that open source projects often contain significant internal competition, even if they're monopolies like GCC or Apache.

    2. 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.
    3. Re:Not a lot of selection for Linux compilers, eh? by doomdog · · Score: 1

      For the OS/2 platform, there were compilers from Microsoft, IBM (C/Set and C/Set++), Watcom, Borland, Lattice, EMX/GCC, and probably a few more that I don't remember...

      It would be nice to have more of a selection under Linux.

    4. Re:Not a lot of selection for Linux compilers, eh? by Waffle+Iron · · Score: 2, Insightful
      You know, it seems there were far more compilers available for DOS and OS/2 than are available for Linux.

      That's most likely because the market for compilers has become more mature. There are usually fewer players left in a mature market than in a new one. It doesn't necessarily have anything to do with open vs. closed source.

    5. Re:Not a lot of selection for Linux compilers, eh? by ChaoticCoyote · · Score: 1

      I don't consider your message to be flamebait. There aren't many C and C++ compilers for Linux. Several companies make Fortran 95 compilers for Linux, but few seem interested in the C community.

    6. Re:Not a lot of selection for Linux compilers, eh? by tetromino · · Score: 1

      Compilers for {Solaris, Irix, HPUX, etc} : {Sun's, SGI's, HP's, etc's}, gcc

      Compilers for Linux: gcc, icc, and Portland's pgcc.

      Compilers for Windows: Microsoft's, Borland's, icc, gcc-mingw

      Most modern OS's, not just Linux, don't have much in the way of compiler choice.

    7. Re:Not a lot of selection for Linux compilers, eh? by doomdog · · Score: 1

      My post wasn't flamebait at all -- just my observation. I think what it boils down to is the fact that gcc is just "good enough" to get the job done for most people -- even if it doesn't generate the best code, or the fastest executables. People use it because its free. A significant number of Linux users _are_ Linux users because they believe in open source (i.e. "I have the right to free software"), and aren't the types that will spend a thousand $$$ or two for a top-of-the-line compiler.

      Since people aren't willing to pay for a good compiler for Linux, no one writes one for Linux (Intel is an exception, because they're interested in showcasing their chips).

    8. Re:Not a lot of selection for Linux compilers, eh? by neurocutie · · Score: 0, Troll
      A troll I suppose...
      C'mon:
      1) You know, it seems there were far more compilers available for DOS and OS/2 than are available for Linux.
      2) To me, this says that Open Source removes software choices from the consumer in the long run,
      3) which means that open source is not a good thing for the general software-consuming public.

      how exactly do you get from 1) to 2) to 3) ? Geesh...

      Yes, there were a LOT of compiler choices under DOS (not so many under OS/2). But that says NOTHING about Open Source REMOVING choices. In order to remove something, it has to exist first. And the fact is that not very many folks have gone to the trouble to write noteworthy C compilers for Open Source, particularly since there already exists a pretty good one (GCC). But nothing has been "removed", actively or otherwise. And just how many C compiler choices are available for Win32 ? Also not very many: Watcom is dead, Borland is basically dead.

      And now how do you get from 2) to 3) ? Have a lot of choices within an environment isn't ALWAYS a good or desireable thing, and certainly not always natural. Particularly for certain core, foundation software, one doesn't necessarily want lots of choices. The compiler upon which most system software is built is certainly a candidate for this category. If Windows has 10 different system calls to open a file and Unix/Linux only has one, does that mean that Windows is better because there are more choices ?

      If part of what you are saying is that in a submarket where there is a lot of money, more produce choices will be offered and florish, sure... though not always (witness Win32 and compilers, or spreadsheets or presentation software). But once again you are confusing Open Source with Free software, and Free with "generates no revenue". The Open Source software business model has not fully matured YET... but the future looks promising to many of us observers.

    9. Re:Not a lot of selection for Linux compilers, eh? by ChaoticCoyote · · Score: 1

      When I first wrote reviews for the early geek magazines (anybody remember Microcornucopia?), I could cover a dozen or more compilers for DOS. Today, the field is very thin. :(

    10. Re:Not a lot of selection for Linux compilers, eh? by doomdog · · Score: 1

      I don't think maturity is the issue here. Was there _ever_ a time when Linux had a large selection of compilers that were eventually whittled down to just gcc and Intel's ICC?

      Somehow, I think it's pretty much _always_ been a one-gcc show on Linux.

    11. Re:Not a lot of selection for Linux compilers, eh? by doomdog · · Score: 1

      And just how many C compiler choices are available for Win32 ? Also not very many: Watcom is dead, Borland is basically dead.
      For Windows, you can get C compilers from Microsoft, Intel, Borland (they're far from dead) and IBM -- and Watcom's compiler is still around as open source and being maintained as Open Watcom. The first four are major commerical offerings, which is a whole lot more choice than what you'll get on Linux.
    12. Re:Not a lot of selection for Linux compilers, eh? by Waffle+Iron · · Score: 1
      By the time Linux made it big, the compiler market was mature.

      Look at the DOS/Windows compilers. There used to be several commercial offerings, including Microsoft, Borland, Watcom, etc. Now just about nobody is left trying to sell a compiler for Windows as an end in itself. Microsoft makes a compiler to help people stay locked into the Windows ecosystem. Intel makes a compiler to help people stay locked into X86 (they focus on raw performance so that X86 can run a few percent faster, helping to keep people from bolting to other architectures). There's a port of GCC to help promote Free software.

      Most of the other commercial offerings were eventually frozen and offered as a freebie novelty on the websites of whatever company ended up with them when the music stopped.

      The only reason that you have slightly more choice in still-under-development compilers on the Windows platform is that the players left in the game have ulterior motives that they're pushing.

    13. Re:Not a lot of selection for Linux compilers, eh? by doomdog · · Score: 1

      Then why does Borland continue selling a C++ compiler? I don't think they have any ulterior motives there -- they just want to sell their software...

    14. 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.

    15. Re:Not a lot of selection for Linux compilers, eh? by Anonymous Coward · · Score: 0


      You know, it seems there were far more compilers available for DOS and OS/2 than are available for Linux. To me, this says that Open Source removes software choices from the consumer in the long run, which means that open source is not a good thing for the general software-consuming public. The ones that benefit from open source are those who don't want to pay for software...


      This is spot on. As long as the "free" gcc is available, even if it isn't any good, there is no market incentive to write a superior alternative, because either it will have to be written for free, which most rational people will not do, or it will have to be sufficiently better than gcc to justify an infinitely larger price. Intel is the exception, because they can justify most of the costs of compiler development as a means of promoting their CPU line, even if they lose massive amounts of money on it. But there is no way a start-up could get venture capital today with a business plan of writing a better C compiler, even if they could in fact write a better C compiler.

    16. Re:Not a lot of selection for Linux compilers, eh? by be-fan · · Score: 1

      Borland's focus is their IDE, not their compiiler. They give their compiler away for free, if you check their website. BC++ isn't a very good compiler, but people put up with it for the nice development tools.

      --
      A deep unwavering belief is a sure sign you're missing something...
    17. Re:Not a lot of selection for Linux compilers, eh? by Waffle+Iron · · Score: 1

      The standard C++ compiler itself can be downloaded for free. The ulterior motive, IIRC (I'm kind of rusty on Borland's products), is to push Borland Builder, which tries to turn C++ into some kind of value-added nonstandard RAD environment. Once again, the vendor's goal is lock-in.

    18. Re:Not a lot of selection for Linux compilers, eh? by be-fan · · Score: 1

      On Linux, you've got:

      Intel C++, GCC, TenDRA, OpenWatcom, and Portland Group C++. Sure, only two of those are commercial, but is it news that Linux has less commercial software than some other OSs?

      --
      A deep unwavering belief is a sure sign you're missing something...
    19. Re:Not a lot of selection for Linux compilers, eh? by calidoscope · · Score: 1
      (anybody remember Microcornucopia?)
      I do - used to pick up an occasional copy back in the 80's.

      Other rags from that era: Microsystems, Interface Age, first 10 years of Byte (Circuit Cellar is still a decent rag).

      --
      A Shadeless room is a brighter room.
    20. Re:Not a lot of selection for Linux compilers, eh? by ChaoticCoyote · · Score: 1

      Most of the compilers you list are not serious contenders. OpenWatcom is planning, but does not yet distribute, a Linux compiler. I found no mention of Linux on the lcc web site. I don't have an Alpha anymore, so the Compaq compiler is not pertinent. I don't have a copy of the Absoft compiler, even though I requested one for review. An interpreter is, as you note, not a compiler. And so on...

    21. Re:Not a lot of selection for Linux compilers, eh? by dryeo · · Score: 1

      Watcom, which was one of the best compilers for DOS, OS/2, WIN, and NT as well as partial Netware support is now open source (openwatcom.org) and Linux support is being added.
      Still a good compiler but showing its age somewhat.
      Dave

      --
      https://en.wikipedia.org/wiki/Inverted_totalitarianism
    22. Re:Not a lot of selection for Linux compilers, eh? by dryeo · · Score: 1

      Actually Watcom has been reborn as open sourced openwatcom. Current plans include a Linux version and fixes to work with configure scripts. See openwatcom.org.

      --
      https://en.wikipedia.org/wiki/Inverted_totalitarianism
    23. Re:Not a lot of selection for Linux compilers, eh? by Wesley+Felter · · Score: 1

      Yes, the same kinds of monopoly-producing, winner-take-all effects exist in open source as in proprietary software. Few people recognize this.

      But PathScale did get VC money to build a better C compiler, and for a niche market: AMD64 scientific computing. I guess it was pretty clever of them to freeload off SGI's open source code.

    24. Re:Not a lot of selection for Linux compilers, eh? by Anonymous Coward · · Score: 0

      Why the fuck does everyone keep forgetting CodeWarrior?

    25. Re:Not a lot of selection for Linux compilers, eh? by Frankie70 · · Score: 1


      Compilers for Windows: Microsoft's, Borland's, icc, gcc-mingw


      For Windows there are also

      Digital Mars - used to be Symantec C++

      LCC

      Open Watcom

      I think there are more for Linux also, like Visual Age
      etc.

    26. Re:Not a lot of selection for Linux compilers, eh? by downbad · · Score: 1
      because it's weird and expensive

      i can't name one piece of software for linux that was developed with codewarrior.

    27. Re:Not a lot of selection for Linux compilers, eh? by Magnus+Reftel · · Score: 1

      You missed PathScale, a compiler for AMD64 that supposedly generates absurdly fast code.

      --
      print "Yet another p{erl,ython} hacker\n",
    28. Re:Not a lot of selection for Linux compilers, eh? by j-pimp · · Score: 1


      Current plans include a Linux version and fixes to work with configure scripts.

      The "fixes" to work with configure scripts are auctually wrapper programs that accept the One True(tm) comman line switch standard for cc, ld and friends. Watcom has always been a very exotic development envirorment. wmake calls the toolchain as dlls, and the build tools have their own command line switch structure.

      --
      --- Justin Dearing http://www.justaprogrammer.net/ We're just programmers.
    29. Re:Not a lot of selection for Linux compilers, eh? by _|()|\| · · Score: 1
      i can't name one piece of software for linux that was developed with codewarrior.

      Are you sure there is a CodeWarrior for Linux? The only product I ever knew was an IDE for GCC.

    30. Re:Not a lot of selection for Linux compilers, eh? by antime · · Score: 2, Informative

      Nowadays LCC-Win32 is a very different compiler from LCC. Jacob Navia bought a license for LCC3.6 (IIRC) and has developed it independently since then. His version has lots of features (eg. optimizers, C99) not in Fraser's and Hanson's LCC. And then there's the whole win32 thing too.. (There is also a "rival" LCC for Windows written by a Swede, called Pelles C.)

    31. Re:Not a lot of selection for Linux compilers, eh? by antime · · Score: 1

      Also Codeplay's VectorC (Windows, Playstation2), Metrowerk's CodeWarrior (just about any platform under the sun).
      For embedded work there's plenty of cross compilers, most CPU vendors have their own toolchains etc. Many of these are special-purpose compilers and have only niche markets, but there are tons of compilers available overall.

    32. Re:Not a lot of selection for Linux compilers, eh? by Anonymous Coward · · Score: 0

      "contributing to GCC makes more sense than writing your own compiler"

      That is a nice sentiment, but working with GCC is a nightmare. Not only is there a lack of documentation, but it's a huge mess of some of the ugliest local-specific C that I've ever seen. It would literally be easier to develop an entire language from scratch and implement it than to contribute in any meaningful way to GCC. It's really a shame.

  22. 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.

  23. C++ compile times? by tetromino · · Score: 2, Insightful

    One of the main reasons I was looking forward to the new GCC versions was faster compile times for C++. Yet it seems that for povray (the only c++ source in the benchmark), the compile times consistently get worse with newer versions of gcc. Does no-one care about people who actually compile kde?

    1. Re:C++ compile times? by PitaBred · · Score: 1

      Let's see... compile time, which is a vast minority of the time spent with an application, or execution speed, which has increased.
      Nope. It's not that they don't care about you, it's that they have their priorities in order. Download the binary if it's going to cause you considerable pain to compile.

    2. Re:C++ compile times? by shutdown+-p+now · · Score: 0
      compile time, which is a vast minority of the time spent with an application
      I use Gentoo, you insensitive clod!
    3. Re:C++ compile times? by sparcnut · · Score: 1
      One of the main reasons I was looking forward to the new GCC versions was faster compile times for C++. Yet it seems that for povray (the only c++ source in the benchmark), the compile times consistently get worse with newer versions of gcc. Does no-one care about people who actually compile kde?


      Moore's Law says that the speed of a computer will roughly double every 18 months. I don't see GCC's compile time doubling anywhere near every 18 months, so the compile time is actually improving with newer hardware.
      --
      perl -e 'print $i=pack(c5, (41*2), sqrt(7056), (unpack(c,H)-2), oct(115), 10);'
  24. Re:I don't get it... that you don't get it... by Jeff+DeMaagd · · Score: 1

    The basic point, simplified, is that the 533MHz FSB Pentium 4 chips don't have EM64T (a.k.a. AMD64, x86-64). Some of the latest Prescott-based chips do have EMT64T, but not the tested equipment.

  25. Mod up!! by Billly+Gates · · Score: 0, Offtopic

    I dont understand why the parent was modified to a -1??

    1. Re:Mod up!! by doomdog · · Score: 0, Offtopic

      Anything not singing the praises of open source is automatically modded down to flamebait... It's slashdot rule #1 :)

    2. Re:Mod up!! by tetromino · · Score: 2, Funny

      Billy Gates is asking why a comment insulting open source was modded -1?

      This is a classic...

    3. Re:Mod up!! by Billly+Gates · · Score: 1

      GCC is not perfect and is designed to be portable. Its a no brainer.

      Also gcc may be finally ready for x86 but lag on other platforms. This is obvious since 99% of the developers use x86.

      But really the reason why there are no commercial c++ compilers is because gcc was there from day 1 and judging by the benchmarks may be good enough for prime time.

      OS/2 and Dos had none so vendors came in to fill that niche.

    4. Re:Mod up!! by doomdog · · Score: 1

      As far as lagging on other platforms... For my development work on Solaris, it is quite interesting to compare the speed of my program using Sun's compiler vs. gcc (gcc is _way_ behind)

    5. Re:Mod up!! by calidoscope · · Score: 1
      When Solaris 10 ships (along with Studio 10), it will be interesting to see how Sun's C compiler stacks up against GCC for the Opteron. I'm assuming you're doing development work on SPARC.

      Sun's C compiler is not a drop-in replacement for GCC - due to Sun's compiler not having some of GCC's -um- interesting features.

      --
      A Shadeless room is a brighter room.
    6. Re:Mod up!! by Anonymous Coward · · Score: 0

      That post has had only positive moderations. It was at -1 because that account has awful karma and posts at -1 automatically.
      I've seen some of this guy's posts before. He flames more often than he actually writes something constructive. Hence the low karma.

  26. illogical hostility? by Anonymous Coward · · Score: 1, Insightful

    Why all the comments that are vehemently pro-gcc? It reeks of a defensive posture when none is necessary. The man is trying to conduct a semi-scientific test. Isn't /. about science and truth and news for nerds that transcends the tripe in the mainstream media? If so, why the instant hostility?

    1. 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?

    2. 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.

    3. Re:illogical hostility? by calidoscope · · Score: 1
      Seems that a significant portion of (but by no means all) Slashdotters have trouble understanding the concept of "using the best tool for the job".

      Your article did not come across as being negative about GCC.

      --
      A Shadeless room is a brighter room.
    4. Re:illogical hostility? by bani · · Score: 1

      The hostility mystifies me.

      you're obviously new around here :)

      ignorant hostility and moderators who cant RTFA are the core of /.

    5. Re:illogical hostility? by nathanh · · Score: 1
      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.

      Hostile people tend to shout the loudest.

      I liked your article and hope to see more of them in the future.

    6. Re:illogical hostility? by Anonymous Coward · · Score: 0

      I am sorry, I don't usually go for this kind of comment, but where exactly did you find a slashdot that is concerned about science and truth instead of emotional posturing? I would certainly like to see it for once.

  27. 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 SirTalon42 · · Score: 2, Funny

      You need more empty soda cans on ur desk to call urself a nerd! I got 6 cans, plus 3 bottles of water (resently threw them all away)!

    3. Re:This guy must be a nerd... by pr0c · · Score: 1

      You should see my work area! Err wait, I'm not sure what it looks like anymore, but its under the coffee cups, beer cans and other crap somewhere...

    4. Re:This guy must be a nerd... by ChaoticCoyote · · Score: 1

      Hey, I've got Ghirardelli Double Chocolate (a tasty bittersweet chip) and Jamaican Rum. Ha!

      The rum probably explains the typos people found in the article. :)

    5. Re:This guy must be a nerd... by hawkeyeMI · · Score: 1

      What did you think of "A New Kind of Science" ?

      --
      Error 404 - Sig Not Found
    6. Re:This guy must be a nerd... by Anonymous Coward · · Score: 0

      Mr. Ladd, you have just become my official hero. I used to suppose that I was the only socially hermetic bastard who sat around with a compiler-driving keyboard in one hand and an icing-laden spoon in the other; now I know that I'm not alone in the universe.

      In all seriousness, I appreciate your compiler comparisons. However, it would be helpful if you'd include a few apps that aren't oriented toward scientific computation, such as the CLucene search engine or the Python interpreter's pystone benchmark.

      The problem with either of those (as I'm sure you're aware) is that I/O would enter the picture to a greater extent than it does in scientific computation, and I/O is a huge can of worms as far as benchmarking is concerned.

      Have you considered including some non-scientific code in your benchmarks, though? There are many of us who write primarily integer and/or string-based code, and don't deal with floating point to any significant extent. I'd be interested to see whether Intel's compiler (or even Microsoft's) is able to pull any integer-centric tricks out of its hat, relative to GCC.

    7. Re:This guy must be a nerd... by ChaoticCoyote · · Score: 1
      Mr. Ladd, you have just become my official hero. I used to suppose that I was the only socially hermetic bastard who sat around with a compiler-driving keyboard in one hand and an icing-laden spoon in the other; now I know that I'm not alone in the universe.

      Well gosh darn, your testamony makes me feel all warm and fuzzy inside. Or maybe that sensation comes from the rum and frosting...

      Have you considered including some non-scientific code in your benchmarks, though? There are many of us who write primarily integer and/or string-based code, and don't deal with floating point to any significant extent.

      As you noted, the problem is finding such a benchmark that doesn't bring I/O and other external latencies into play. I'm open to suggestions like yours.

    8. 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.

    9. Re:This guy must be a nerd... by k0ft · · Score: 1

      You should see my work area! Err wait, I'm not sure what it looks like anymore, but its under the coffee cups, beer cans and other crap somewhere...

      I totally know what you mean...

    10. Re:This guy must be a nerd... by acceleriter · · Score: 1

      I don't know which is worse--all the beer bottles, or that I noticed the VT-220 before noticing the beer bottles.

      --

      CEE5210S The signal SIGHUP was received.

    11. Re:This guy must be a nerd... by mikefe · · Score: 1

      Is that the one next to the sun machine on the left?

      --
      There: Something at a specific location.
      Their: Owned by someone.
      Please make sure your english compiles.
    12. Re:This guy must be a nerd... by k0ft · · Score: 1

      I don't know which is worse--all the beer bottles, or that I noticed the VT-220 before noticing the beer bottles.

      I really like my vt-220

      The Alphaserver 4100 in the picture has 4 processors and 2.5GB ram. In the winter i wont have to use the central heat.

    13. Re:This guy must be a nerd... by acceleriter · · Score: 1

      Yup. On the left side, above and to the right of the Sun box.

      --

      CEE5210S The signal SIGHUP was received.

    14. Re:This guy must be a nerd... by Anonymous Coward · · Score: 0

      I laughed so hard when I saw that picture, but it was tinged with irony. Back when I was younger and could metabolize it, I'd have one of those very same frosting packages beside my keyboard while I worked. The sugar high from that stuff is GREAT, and you come down off it faster than coffe so you can sleep when it's finally time to shut down at dawn.

      Side effect is that much sugar and crap plays havoc on your innards and leaves a guy feeling pretty low the next day.

      I preferred the chocolate frosting.

    15. Re:This guy must be a nerd... by bhima · · Score: 1

      I just you're not miking the Gatorade with the Olde English

      --
      Nothing in the world is more dangerous than sincere ignorance and conscientious stupidity.
    16. Re:This guy must be a nerd... by gowen · · Score: 1
      Turning that supposition into real science is something I hope to see happen in the next century.
      Well, it is, but (seemingly) simple multi-dimensional systems have an unpleasant trend of having chaotic attractors, which limits the amount of stuff you can actually do with them.
      --
      Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
  28. 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?

    1. Re:commercial thinking by ChaoticCoyote · · Score: 1
      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 provide compile times for those benchmarks that ran long enough for a valid measurement to be taken. Clearly GCC is getting slower, and as a Gentoo user, I find that troubling. The GCC development focus is on features and code generation, though there are those who are working diligently on increasing GCC's speed. We'll have to see how GCC 4.0 evolves before its release.

      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.

      As I state in the review, I don't use Eclipse for C or C++ development, nor have I tried the version shipped with Intel's compiler. While Eclipse is reasonable for Java development, it's just too damned slow for me to use in a C environment.

      Or maybe they weren't available yet at all: when WAS the Intel 8.1 compiler released, anyway?

      August 2004.

    2. Re:commercial thinking by Anonymous Coward · · Score: 0

      > as a Gentoo user, I find that troubling

      Well, compilers were not meant to be system administration tools, so tough titties. (says the developer)

      Besides, isn't "optimization" the main point of Gentoo anyway? If GCC is producing better code, the Gentoo crowd should be happier even if it takes twice as long. After all, the quickest install solution will always be binaries.

    3. Re:commercial thinking by Anonymous Coward · · Score: 0

      But but but, since GCC is getting better at optimization, surely by spending the time on making GCC a better optimizing compiler, they can then recompile GCC with GCC (as they like to do), and make GCC even faster! Profit!!!

      This kinda shows the silliness of relying on compiler optimizations to make your programs fast, when the real money is in algorithms and data structures. Just download the stupid i386 binaries, they're more than good enough.

    4. Re:commercial thinking by stonecypher · · Score: 1

      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)

      And in many studies, it has been shown that most large projects - both commercial and open source - can benefit significantly from the proper use of translation units, showing an average of 70% drop in compile time when the code is properly modularized, and occasionally seeing drops as large as 90%.

      Switch tools only when you've learned all the techniques available. What you benefit from techniques carries. What you benefit from tools does not.

      --
      StoneCypher is Full of BS
    5. Re:commercial thinking by Bert64 · · Score: 1

      Well, gcc may well get slower and the programs it compiles may well get bigger too. But on the flip side hardware is getting faster and technologies like distcc are appearing to improve compile speed.. So it's really a race between software authors to make slower software and hardware makers to make faster hardware, same as it always has been.... The end user experience appears roughly the same speed as it always has been.

      --
      http://spamdecoy.net - free throwaway anonymous email - avoid spam!
  29. Re:Busy eyeballs are better than idling eyeballs by tetromino · · Score: 0, Offtopic

    Brilliant! Mister Coward, your troll is truly creative and deserves our applause.

  30. Not everyone is a userh by dtor_sdt · · Score: 1

    Well, world consists not only of users but some people also develop stuff that you run. And for them compile times are also very important.

    1. Re:Not everyone is a userh by Jeff+DeMaagd · · Score: 1

      There is no mention of the run time benefits of the newer gcc software.

      Assuming the code will work with any reasonably recent version, go back a few versions and use that for development, and to the newer versions for compiling and testing binaries that will be distributed.

    2. Re:Not everyone is a userh by dtor_sdt · · Score: 0
      Well, the thing is that diagnostic is much better with newer GCC versions so I like compiling with somewhat recent compiler. I would not want to roll back to 2.95 something. Plus, with C++ it seems like every new version has a new ABI so switching versions is a major PITA.

      I thought that work on improving compile times was on its way but from the posted results it looks like that particular snapshot was like 2 times worse than 3.3 (2:35 vs 1:12 for POV-Ray compile, 1:08 vs 0:36 for Lame). Hmm.. I just noticed that results are much better on Pentium box, I wonder why is that... Still GCC 4.0 is again slower than previous versions. That is my gripe - it gets slower and slower with every released version.

    3. Re:Not everyone is a userh by Anonymous Coward · · Score: 0

      I do develop software, and sure, it's a pain in the ass to compile something on the 486DX/100 laptop I use sometimes for text editting in bed, but you know what? I just get up and do something else. Most of my development (read: debugging) takes place on an Athlon 2400+, and it screams through source code so fast that I barely have time to watch the occasional warning message flash by. It helps that I actually know how to use a debugger and don't need to keep recompiling my code to put in pointless print statements (as opposed to useful print statements, which I throw in for the bugs involving complicated execution paths).

      Compiling can take time, but I generally find this is the case when people don't take care to break up their source code into suitably small and manageable chunks. Developers rapidly iterate over their code, so we've come to rely on build systems (make and friends) which only really end up recompiling a very small portion of the source tree. With good organization, the number of lines of code that get recompiled is usually in the low 1000s or less, and that just flies on a modern computer, no matter how fancy the code is (although C++ templates headers that suck in 10000 lines of code can sometimes be a pain to recompile--I try to avoid doing anything that requires debugging something like that extensively).

      Now, that doesn't mean anything for the guy who wants to compile KDE from source, since they're generally downloading a fresh tarball or make clean, and then recompile the whole ball of wax, just to be sure that the dependencies are all up to date. I get annoyed enough when I have to recompile my kernel, which I do much more often. Still, if it's really such a big deal, compilation is one of those processes which lends itself very readily to parallelization (distcc): Lots of independent units which don't need to see each other until the final link step... yoke a few spare computers together (admit it, all true geeks have at least 5+ spare computers lying around) and go to it.

  31. Re:I don't get it... that you don't get it... by Jeff+DeMaagd · · Score: 1

    Oops, Intel's name for x86-64 is EM64T, not EMT64T.

  32. 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 ChaoticCoyote · · Score: 2, Interesting

      I'm working on a Fortran 95 comparison, which will include several products.

      Most people doing serious numerical work are creating proprietary or in-house applications; few people have the clusters required to run the type of code written in Fortran. So there is a commercial market for Fortran; places like National Laboratories and universities have the money to buy software.

    2. Re:C/C++ vs. Fortran by be-fan · · Score: 1

      I don't think it does anything of the sort. First, there are more than two C++ compilers for Linux. There are over a dozen C compilers, and several C++ compilers (ICC, GCC, OpenWatcom, Tendra). Second, the reason for the dearth of C++ compilers is because C++ is an ugly language that is nearly impossible to implement correctly. Only one front-end, EDG's (which is used by ICC and Comeau) can claim to be fully conformat to ISO C++ 98, and only two others, GCC's and Visual C++'s, can claim to be mostly conformant.

      You might be right about Fortran not being dead, but you can't reach that conclusion from the facts you presented.

      --
      A deep unwavering belief is a sure sign you're missing something...
    3. Re:C/C++ vs. Fortran by Aardpig · · Score: 1

      There are over a dozen C compilers, and several C++ compilers (ICC, GCC, OpenWatcom, Tendra).

      Are you sure about this? From checking the OpenWatcom web pages, it appears that their compiler only runs on Windows and OS/2. Likewise, the Tendra documentation indicates that Linux support is aimed at kernels 1.2.8 and 2.0.27; is this compiler still being actively developed on the Linux platform?

      Also, out of interest, could you name some of the dozen C compilers? And isn't Visual C++ a Microsoft product? Do they have a Linux product?

      You might be right about Fortran not being dead, but you can't reach that conclusion from the facts you presented.

      Why ever not? Do you really think that so many vendors would bother creating a compiler for a dead language?

      --
      Tubal-Cain smokes the white owl.
    4. Re:C/C++ vs. Fortran by entrigant · · Score: 1

      Or it proves a fortran compiler is easier to write :)

    5. Re:C/C++ vs. Fortran by Anonymous Coward · · Score: 0

      (I'm not the original author but here are two)
      Tiny C
      LCC

    6. Re:C/C++ vs. Fortran by be-fan · · Score: 1

      You're right about OpenWatcom --- the Linux port is not done yet. TenDRA's documentation is out of date --- it is actively developed on all supported platforms, the last release was about six months ago.

      As for other compilers, there is: LCC, TinyC, Compaq C (only for Alpha), CodeWarrior, PGI CC, Comeau, IBM's XLC (only for PowerPC), and a number of others.

      Why ever not? Do you really think that so many vendors would bother creating a compiler for a dead language?
      My point is that the relative number of C++ compilers to Fortran compilers has little to do with the activity levels of the language communities, but the relative difficulty of implementing C++ as compared to Fortran.

      --
      A deep unwavering belief is a sure sign you're missing something...
    7. 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

    8. Re:C/C++ vs. Fortran by Brandybuck · · Score: 2, Interesting

      the reason for the dearth of C++ compilers is because C++ is an ugly language that is nearly impossible to implement correctly.

      I would rephrase that to say that C++ is a *big* language with a spec managed by committee.

      --
      Don't blame me, I didn't vote for either of them!
    9. Re:C/C++ vs. Fortran by TheRaven64 · · Score: 1

      Not to mention IBM's xlc (for POWER and I believe PowerPC playforms) and TenDRA (BSD licensed, not sure about the supported platforms).

      --
      I am TheRaven on Soylent News
    10. Re:C/C++ vs. Fortran by k98sven · · Score: 1

      As a former Watcom user (albeit one with fond memories) there's OpenWatcom too.

    11. Re:C/C++ vs. Fortran by ChaoticCoyote · · Score: 1
      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:

      In the article, I explicitly state that I'm open to testing other compilers; in fact, Comeau has already contacted me. I have attempted to obtain review compilers for PGI and Pathscale, without success.

    12. Re:C/C++ vs. Fortran by randombit · · Score: 1
      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:

      There also is/was:

      KAI C++ is basically dead (Intel bought them a couple years back, which sucks, as KAI was about the best C++ compiler I have seen), and I'm not totally sure about Compaq's Alpha compiler, but it looks like the SGI Pro64 compiler is still alive (and GPL'ed now... interesting).

    13. Re:C/C++ vs. Fortran by stonecypher · · Score: 1

      I find it interesting that you believe that there are only two c/c++ compilers available for linux, when simple googling shows more than two dozen. Maybe read some of the other people staring at trolls like you, which have come up with TCC, Compaq Alpha C, OpenWatcom C/C++, TenDra C/C++, egcs, ChEmbeddable, Cint c/c++ interpreter, Absoft C/C++, lcc, metaware high c/c++, iacc, ghoc (green hills), and so on.

      Mod parent down.

      --
      StoneCypher is Full of BS
    14. Re:C/C++ vs. Fortran by Anonymous Coward · · Score: 0

      That's ain't two dozen kid(those aren't all "c/c++ compilers available for linux" either).

  33. Mixing versions of Intel-compiled code is problem by Anonymous Coward · · Score: 2, Informative

    One thing that the article doesn't focus on, but is also an issue for developers is the effect of actually using the compilers in a realistic development environment, where you have to integrate code from several vendors.

    I write code for a large enterprise software company, and was investigating using the Intel compiler. More specifically, I needed to use Xerces, Xalan, and ICU, and Xerces and Xalan come with pre-compiled binaries that are compiled using the Intel compiler.

    I started investigating, and one of the major hurdles I ran into was that Intel's CRT, libcxa.so has issues when linking several shared libraries that themselves individually link to different versions of libcxa.so.

    For example, DB2's client libraries are evidently compiled using Intel's C++ compiler, but our DB2 client libraries were using a relatively old version, I think version 3. The Xerces libs were compiled using an newer version of Intel's compiler, I think version 5 or 6. When I tried to link my entire binary, I ran into run-time issues where the expected libcxa.so's conflicted.

    We ended up ditching the entire thing and compiled Xerces and Xalan ourselves using gcc.

    The other issue, of course, is what is our rights to distribute libcxa.so? I figured the entire thing wasn't worth it.

    However, the Intel compiler did generate much better warnings and errors and in general felt much more polished. It wasn't for us, but it's something that should definitely be investigated if you want something that is commercially supported.

  34. Re:Mixing versions of Intel-compiled code is probl by ChaoticCoyote · · Score: 1

    Good points.

    I've had problems using Intel to integrate existing libraries. As of version 8.1, the binary compatibility is supposed to be better, but I haven't had a chance to apply it to a really big project. In all fairness, GCC has had some similar problems with the C++ ABI at times.

  35. 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)
  36. 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 Anonymous Coward · · Score: 1, Informative

      > 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.

      Note that optimization algorithms haven't changed much between gcc-3.3 and gcc-3.4. What has changed dramatically, however, is the C++ parser.

      It could well be that your code, being parsed differently, now hits parts of the optimizing middle-end that haven't been hammered on before and show a crack.

      Please submit a bug report - thanks.

      Toon Moene (A GNU Fortran maintainer and physicist at large)

    2. Re:gcc 3.4 still a little unreliable by Anonymous Coward · · Score: 0

      Not exactly correct.

      The poster should try -fno-unit-at-a-time.

      There have been huge changes in the inlining algos for 3.4.x compilers.

      If you are dealing with C++ code this will improve runtime results.

      However, perhaps problems remain. You should talk to the gcc maintainers and use gcc bugzilla for this.

    3. Re:gcc 3.4 still a little unreliable by Anonymous Coward · · Score: 0

      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,)

      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.

    4. 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.

  37. Interesting image. by arose · · Score: 2, Funny

    Both Coke and Pepsi. What's the benchmark on those?

    --
    Analogies don't equal equalities, they are merely somewhat analogous.
    1. 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.

    2. Re:Interesting image. by Anonymous Coward · · Score: 2, Funny

      Cheesy passive-agressive self deprecation comedy mixed with a "slip it to 'em that I probably had sex at least once" tangent? Thank god I didn't read your article.

    3. Re:Interesting image. by Anonymous Coward · · Score: 2, Funny

      No time to read the article, but time to troll through endless /. posts looking for sexual innuedo? Yes, *I* read all the posts as well, but I'm not being dishonest...

    4. Re:Interesting image. by ChaoticCoyote · · Score: 2, Insightful
      Cheesy passive-agressive self deprecation comedy mixed with a "slip it to 'em that I probably had sex at least once" tangent? Thank god I didn't read your article.

      Sounds like jealousy to me... ;)

    5. Re:Interesting image. by Anonymous Coward · · Score: 0

      Hey, I had sex once. I think. The priest called it a blessing and all, but I didn't shit right for a week.

  38. Compiler speed by Anonymous Coward · · Score: 0

    Okay, it's nice to have optimizations to generate fast code and all, but the best thing the gcc folks could do for free software is improving compilation speed. While the c compiler isn't too bad (still slow in comparison to other compilers I've seen), the c++ compiler is just plain awful (it appears that 4.0 is even *worse*). I once saw a 40 line c++ program that used template meta-programming techniques take 120 seconds to compile w/o any optimizations turned on. . .with -O2 optimizations turned on, it took 28 minutes to compile.

  39. Are these tests even a valid measure? by skids · · Score: 2, Insightful

    Seems to me, you don't test the speed of a compiler on number crunching programs -- they are likely to have hand optimizations in them, and can benefit from hand optimization a lot more, so the compiler isn't as important in these applications since if you want real speed you write a core in asm.

    He should have tested code that contains a lot of tangled up complex loops switches and jumps. Like libperlre's parsing and execution speeds. That and some really horribly over-abstracted C++ code where 15 classes are used just to add two numbers together.

    (Perhaps the best test would be to compile a second copy of one version of gcc, and see how fast that can compile itself afterwards.)

  40. Comeau C++ by Anonymous Coward · · Score: 0
    You left out one of the most important commercial C++ compilers: Comeau C++. Comeau C++ has been around for Linux almost as long as g++, and offers
    • Maturity
    • Speed
    • Correctness
    • Standards Compliance
    • Inexpensive and affordable
    • for Linux and other platforms
    Anyone doing a survey of C++ compilers for Linux better damn sure include Comeau C++. It was the first standards compliant C++ available for Linux, and it can trace its roots directly to Bell Labs.
    1. Re:Comeau C++ by ChaoticCoyote · · Score: 1

      Comeau has contacted me by e-mail, so they'll likely be included in future updates.

  41. Re:Mixing versions of Intel-compiled code is probl by out_of_ideas · · Score: 1
    As of version 8.1, the binary compatibility is supposed to be better


    So folks, please recompile everything to take full advantage of the improved binary compatibility !
  42. If you must have optimized support for AMD... by Ayanami+Rei · · Score: 2, Interesting

    Portland Compiler Group has a compiler that's fairly decent and optimizes for both AMD64 and Intel 32-bit (although they're pushing the AMD64/clustering angle right now).

    It's nice, but much less free. 15-day free trial. Prices are not bad, but it's still a little steep, even for an academic license.

    This is not a plug... just in case anyone was wondering if there was something besides ICC you could try in to benchmark GCC on something that ICC can't cope with.

    --
    THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
  43. 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.
  44. Visual debugger for Intel compiler? by Chuck+Messenger · · Score: 1

    Spurred by the article, I decided to give the Intel compiler a go. However, one stumbling block I've come across is that it doesn't seem to have a visual debugger. That is, idb is akin to gdb. I'm interested in something like gvd or ddd.

    Does anyone know of a way to do visual debugging on the Intel compiler's code? (thoughts which come to mind: maybe the Eclipse environment? Maybe a gcc debugger, like gvd, would work on icc's code? Maybe there's another Intel product for visual debugging?)

    1. Re:Visual debugger for Intel compiler? by Anonymous Coward · · Score: 0

      You can activate the GUI using "idb -gui".

      The other way to go is use it with the option of the
      GDB command set within a GUI debugger wrapper such
      as DDD.

  45. 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.

    1. Re:GCC usually whips ICC for me by Anonymous Coward · · Score: 0

      It depends on your code. If your code blows out the CPU cache often then there isn't much performance difference. If however your code is tight then ICC will be somewhat faster (25%-50% faster seems common). ICC is very good at vectorization given proper code. Something which wasn't added to GCC until recently.

      So it seems your code just sucks.

    2. Re:GCC usually whips ICC for me by BasharTeg · · Score: 1
    3. Re:GCC usually whips ICC for me by Baudelaire76 · · Score: 1

      The code deals with arrays that are several orders of magnitude larger than the cache. The data are usually accessed sequentially, so the cache hit rate is as good as can be.

      Regardless, the fact remains: given the same code, GCC does a (much) better job than ICC.

    4. Re:GCC usually whips ICC for me by bogdan · · Score: 1

      That's my experience as well for my programs in plain C (again numerical stuff).
      I have this theory that ICC outperforms GCC only for less than ideal code written by naive scientists.

  46. Don't vote for the sake of voting by Anonymous Coward · · Score: 0

    Apathy is under-rated. Ignorant mouth-breathers should remain apathetic.

  47. 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

  48. +5 informative? what the fuck? by bani · · Score: 1

    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.

    obviously someone needs glasses.

    RTFA.

    I quote:

    Corwin (Homebrew)
    Gentoo AMD64 GNU/Linux, kernel 2.6 SMP
    Dual Opteron 240, Tyan K8W 2885


    there you go, a dual opteron. duh?

  49. bad link by Anonymous Coward · · Score: 0

    all I saw was some hot anime chick...

  50. confirmed by bani · · Score: 1

    i've seen increases of over 50% running the same 32bit code on an opteron in 32bit mode. there have been some fundamental architectural changes that make running 32bit code a lot faster than the equivalent p4 or athlon - changes that aren't due to l1 or l2 or on-die memory controller either - but rather fundamental changes with the way instructions are dispatched and processed.

  51. Re:GOT IT! by Anonymous Coward · · Score: 0

    Indeed. The standard mandates this behavior; it dates from the K&R days.

  52. Intel Compiler by Anonymous Coward · · Score: 0

    We run several Intel P4 Xeon (HT) machines at work for our databases, until recently we were either compiling with GCC or using the MySQL official binaries.

    I saw binaries on the MySQL site compiled with the Intel Compiler so I gave it a shot. We've seen much better performance, queries probably run from 15-20% faster. I don't have the exact numbers with me now but the mysql benchmark suite really showed improvement.

    I highly recommend you at least check these binaries out if you're running Intel database servers.

  53. 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

    1. Re:A few editorial notes. by Anonymous Coward · · Score: 0

      If people are making those types of sematic mistakes then something is wrong.

      In other words, open-source/free-software/whatever idiots are awful marketers. If you want your stuff to be accepted then it needs to be understandable by the common person.

    2. Re:A few editorial notes. by ChaoticCoyote · · Score: 2, Informative
      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.

      You can not have freedom without choice. Competition in a diverse environment is the engine of evolution; any monoculture stagnates. I no more want a world run by RMS than I do a society that is beholding to Mr. Gates. A pox on both their monopolistic houses.

      I believe in the competition of ideas, and strongly support and defend the concept of intellectual freedom. I've debated these issues with RMS directly, so I've been through this war before. Much as I respect his ideals, his implementation is lacking and his approach dogmatic and absolutist. Freedom involves the right to disagree with RMS and his acolytes.

      Many argue that we cannot have democracy if we focus on choice: two dominant US political parties have and will cooperate and pursue the same ends (through scheduling exclusionary debates, supporting bills the public doesn't agree with, raising ballot-access levels, making elections prohibitively expensive, etc.)

      The current U.S. political system does not offer significant choice, which is precisely why we need diversity. The difference between Demicans and Republocrats is so small as to be meaningless; trading Kerry for Bush is nothing more than changing dance partners while the same tune plays.

  54. Re:I don't get it... that you don't get it... by Coryoth · · Score: 1

    You'll note that amongst the replies to the original post was a post from the author of the article, noting the error (apparently a typo) and saying he had now corrected it. I suspect you saw the corrected version (and I agree, it now is).

    As for the amount of mod points my post got - who knows, mods on crack. I was just trying to write something useful for all the people who failed to note the original posters point. Check the immediate parent of my post if you're curious - there was some misunderstanding initially.

    Sorry for any confusion.

    Jedidiah.

  55. Compatibility issues by captaineo · · Score: 2, Interesting

    Regardless of benchmarks, I consider the nasty backwards compatibility issues of GCC a serious problem. Virtually all of my Linux tech support time over the last two years has been spent messing with libstdc++ or libgcc_s versions to get various software packages to run. The problem is exacerbated because these libraries in turn are coupled tightly to glibc and pthreads, leading to more versioning headaches. My #1 wish for GCC is to get these libraries set in stone and make them as independent of glibc/pthread versioning as possible. I really want to be able to install a random C++ binary and have it work the first time.

    Also, the ability to compile a C++ DSO without requiring the exact same compiler version as the program that will load it, is a major need for commercial Linux software vendors.

  56. Comparing _GNU_ C and C++ Compilers by latroM · · Score: 1, Insightful

    Those are GNU's compilers, not linux's. Why do you take all the credits from GNU which was the oríginal developer of the system? By calling the whole OS Linux, people who hear it first time think that Linus started it all with his kernel and there wasn't anything before that. Please, GNU/Linux and GNU's compilers.

    1. Re:Comparing _GNU_ C and C++ Compilers by drewness · · Score: 1

      He's not claiming that they belong to Linux. He's comparing Intel's icc compiler to GNU's gcc compiler *on* Linux.

  57. Re: demonstration: 3.5 vs. 4.0 by Anonymous Coward · · Score: 0
    The last transition was
    ftp://gcc.gnu.org/pub/gcc/snapshots/4.0-20040911/d iffs/gcc-3.5-20040905-4.0-20040911.diff.bz2

    Actually, there is not GCC-3.5 snapshot in this ftp.

    open4free ©

  58. Re:Mixing versions of Intel-compiled code is probl by Anonymous Coward · · Score: 0

    Depends.
    For mission critical applications, compiling on BOTH is a huge advantage - namely getting, or seeing different errors and warnings.

    No matter which side of the fence you sit on, trying something different can be a real eye opener. Familiarity breeds contempt.

    In Testing, you should try to break things, expose weaknesses. Contractors often switch compilers, switch off checks, and the client says geeez those guys are good - all their stuff compiles clean. Lucky the client never bothers to scratch, or think terribly hard.

  59. 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.

    1. Re:Silly gcc optimizations by Anonymous Coward · · Score: 1, Informative

      It will let code through if there isn't too much of it.

  60. Comparing Linux C and C++ Compilers? by Pan+T.+Hose · · Score: 1

    What is exactly the point of comparing gcc and g++?

    --
    Sincerely,
    Pan Tarhei Hosé, PhD.
    "Homo sum et cogito ergo odi profanum vulgus et libido."
    1. Re:Comparing Linux C and C++ Compilers? by ChaoticCoyote · · Score: 1
      What is exactly the point of comparing gcc and g++?

      Two reasons:

      1. I'm tracking the recent evolution of GCC, looking for answers to questions like: Are new versions of GCC better than their predecessors?
      2. Different Linux systems use different versions of GCC. My Opteron's Gentoo was compiled with 3.4.1, while my Pentium 4 uses 3.3, for example. Some people stick to older versions for stability or code quality purposes, too.
    2. Re:Comparing Linux C and C++ Compilers? by stonecypher · · Score: 1

      How you made it to PhD without the ability to understand article bylines, much less to RTFP, is beyond me.

      --
      StoneCypher is Full of BS
  61. The real fun will begin when it outclasses GCC by Anonymous Coward · · Score: 1, Insightful

    Politics is holding GCC back once again ... FSF better pray LLVM doesnt get critical mass, or it will be EGCS all over again.

  62. What about documentation to write new front ends? by master_p · · Score: 2, Interesting

    I am especially interested in GCC because I want to write a new front end (my own programming language). I don't want to mess with back ends, since I am not interested in that stuff; the linguistic part of the programming languages is far more interesting. But I can't find decent documentation anywhere on the internet for a GCC newbie. I tried looking at the source code, but it is an ugly mess of macros. The article of course mentions C/C++ only, but GCC is something more than that...I think it deserves a well written piece of how to extend it with new front ends.

  63. Don't forget IBM VisualAge C++ by DenialS · · Score: 1

    IBM VisualAge C++ is also supported on Linux.

    You might ask "why?" -- and the answer is the same as if you asked "Why are companies still selling Fortran compilers?": a whackload of existing, working code and a build environment that would cost mega-bucks to port to a new set of tools.

    It would be interesting to see how VisualAge compares on ChaoticCoyote's benchmark. I hope IBM contacts him to get into the next edition of his benchmarks.

  64. Compile time by Per+Abrahamsen · · Score: 2, Interesting

    I always get confused about people claiming compile time is important for development. It seems to be people who make a habbit of compiling everything from scratch. Haven't they heard of make? To me, link time is the limiting factor. When I make a change, I have to compile just the file I changed, or maybe a handfull of files if I changed an interface. And then I have to link all 236 files, which is where the time is spend.

    I can see it compile time being important to people who use the compiler as an install tool (like gentoo users), but not for any serious developers.

    1. Re:Compile time by GlassHeart · · Score: 1
      I always get confused about people claiming compile time is important for development. It seems to be people who make a habbit of compiling everything from scratch. Haven't they heard of make?

      It depends on the project. Working on a cross-platform project means that a developer must make several builds before checking in a change. You don't have to compile everything from scratch for that to quickly add up.

      It also depends on the phase of the project. Early on, it's more likely that developers make big changes before compiling. After code completion, it's more likely that developers make one or two line bug fixes and need to re-compile.

      [...] And then I have to link all 236 files, which is where the time is spend. I can see it compile time being important to people who use the compiler as an install tool (like gentoo users), but not for any serious developers.

      The project that my team is working on contains nearly 10,000 targets, not all of which have very good dependencies set up as the software aged. I guess we're not serious developers.

    2. Re:Compile time by Per+Abrahamsen · · Score: 1

      > Working on a cross-platform project means that a
      > developer must make several builds before checking
      > in a change. You don't have to compile everything
      > from scratch for that to quickly add up.

      Presumably you have to link several times as well, which mean the link time *still* dominates.

      > Early on, it's more likely that developers make
      > big changes before compiling. After code
      > completion, it's more likely that developers
      > make one or two line bug fixes and need to
      > re-compile.

      Early on, the project isn't as big, so a complete build isn't as bad. At least for me, my project is today 7 times as big as it was when it was "complete" (i.e. did was it was initially planned to do and started getting used). Looking at the big free software projects (gcc, Linux, KDE...) that seems typical.

      > The project that my team is working on contains
      > nearly 10,000 targets, not all of which have
      > very good dependencies set up as the software
      > aged. I guess we're not serious developers.

      At least, you probably need to set off more time for refactoring. Using a faster compiler sound more like a band-aid than a solution. Too strong coupling has other (and more serious) bad effects than long compile times.

    3. Re:Compile time by GlassHeart · · Score: 1
      Presumably you have to link several times as well, which mean the link time *still* dominates.

      I'm not arguing as to which is dominant, but whether compile time is negligible.

      Early on, the project isn't as big, so a complete build isn't as bad.

      I've never joined that commercial project that early. They've all been already pretty big, and getting bigger. This means that it's my usage pattern (big changes + build vs. small change + build) that determines the percentage of my time is spent waiting for the build versus coding or testing.

      At least, you probably need to set off more time for refactoring. Using a faster compiler sound more like a band-aid than a solution. Too strong coupling has other (and more serious) bad effects than long compile times.

      I don't disagree. However, I'm not saying that a faster compiler is the best solution to our problems. I'm telling you that compile time is a problem, not only for those who don't know how to write makefiles.

  65. C or C++? by freakmaster · · Score: 1

    he does mentiont that the SciMark benchmark is only in C. Should I then assume that all the other tests are C++? Otherwise great article and I'd love to see more on the topic.

  66. The main point is customization by Krischi · · Score: 1

    No, the point of Gentoo is not optimization, although it is certainly possible to use the distribution in this fashion. The main point is that Gentoo is a meta-distribution that lets you customize the setup every which way. Other distributions make package configuration decisions for you, whereas Gentoo allows you to make them yourself.

    Want ALSA support in everything? No problem. Want to disable KDE or Gnome for every package? No problem. Want to add IMAP and LDAP support to everything? No problem. All that is necessary is to set the USE flags.

    Since Gentoo is more or less a bleeding-edge distribution, packages get updated frequently. Under these circumstances, compiler speed is far more important than every last bit of optimization, unless you are one of those power-user-masochists. :)

    1. Re:The main point is customization by Anonymous Coward · · Score: 0

      Then it sounds like Gentoo is working around defects in the applications. There's no reason to have compile-time configuration -- the stuff should be selectable at runtime at very little cost.

  67. ICC/GCC by Anonymous Coward · · Score: 0

    What happens to GCC's compile times when it's been compiled with ICC?

    Honest question - and one I think could be quite useful to know the answer to :-)

  68. icce 8.1 is out by tetabiate · · Score: 1

    Does anybody knows if icce 8.1 produces optimized
    code for Opteron processors? How close is Intel's
    extended memory 64 technology to AMD x86_64?

  69. compiling linux with a different compiler? by polyp2000 · · Score: 2, Interesting

    Does anyone know if it is possible to use one of the alternative compilers ICC , OpenWatcom or Corneau ? to build a linux system from scratch?

    I would be truely intrigued at what overall performance might be like.

    --
    Electronic Music Made Using Linux http://soundcloud.com/polyp
  70. 1983 called.... by tundog · · Score: 3, Funny


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

    --
    All your base are belong to us!
    1. Re:1983 called.... by Anonymous Coward · · Score: 0

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

      1789 called and it wants its English language back. Post in Esperanto, loser!

  71. So, turn off optimization during development. by Anonymous Coward · · Score: 0

    Then turn it on for final testing and deployment.

    Jeez.

  72. But if you look at performance... by chipmeister · · Score: 1

    I am currently working on neural simulations of the motor cortex. The machines I have for development are dual pentium IIIs - the production environment is 128 processor linux cluster. I have compiled my programs both with gcc and intel and have to say the pentium III sse compiler directives and loop optimizations appear to produce faster code (approx. 10% faster) using the Intel compiler. This means a lot on a real simulation (approx 30 hours).

    So if your goal is to get code to run fast on Intel platform the Intel compiler may have it's advantages.

  73. Re:GOT IT! by scotch · · Score: 1

    C++ has an implicit return EXIT_SUCCESS from main. The lack of a declaration for printf, however, makes this first post highly suspect.

    --
    XML causes global warming.
  74. Re:Mixing versions of Intel-compiled code is probl by Anonymous Coward · · Score: 0

    There's been an effort from the GCC developers and the Intel icc people to converge, with gcc-3.4.0, on to a C++ ABI that is more correct than had existed previously (ie gcc-3.2.x, gcc-3.3.x, icc-pre-8.1x)

    Some of this is compiler-side: g++ bugs were fixed and implementation errors in the IA64 C++ ABI were ironed out.

    Some of this is library-side, where libstdc++ can now be compiled with non-g++ front ends.

    See:
    http://gcc.gnu.org/ml/gcc-patches/2004-04/ msg00375 .html

    I've not had any problems using gcc-3.4.0 and libstdc++.so.6.0.x mixed in with object files created with icc-8.1.

    It's actually quite cool that this can be done now. I was surprised to not see this hyped more, actually.

  75. LLVM better C++ compiler than GCC? by Anonymous Coward · · Score: 0

    it's happened already - some of the main C++ benchmark programs run faster under LLVM than with GCC. Competition is a very good thing. Let's see if GCC's SSA will turn the tide.

  76. Rum & Coke & the Other Half... by burnttoy · · Score: 1

    She INSISTS on Diet Coke... Only "full fat" Coke does it for me.... Rum is probably one of my favourite hobbies! ;-)

    --
    Time flies like an arrow. Fruit flies like a banana.
  77. Re:What about documentation to write new front end by stonecypher · · Score: 1

    Jesus. It's two clicks from the GCC front page: hit 'front ends' on the link list to the left, then the second link down, 'other links and readings'.

    If you can't make it to the first line of the third paragraph in the front ends front page, you're probably not cut out to write a new front end, and it's a hell of a lot harder to write a GCC front end than it is to write a whole new compiler. Truth is, you really should be looking at YACC and BISON, not GCC at all. Go read Aho before you attempt anything further.

    --
    StoneCypher is Full of BS
  78. Re:GOT IT! by Anonymous Coward · · Score: 0

    What behaviour? You mean perhaps undefined behaviour? The prototype of printf isn't "int printf(char *)". All bets are off once you call it with that prototype.
    Besides, implicit function declarations have been deprecated since 1999 anyway.

  79. BloodShed by Anonymous Coward · · Score: 0

    Worked pretty well when i used it for class projects.

    http://bloodshed.net/

  80. Re:What about documentation to write new front end by master_p · · Score: 1

    I've read most of the material supplied in the links you have posted...it's inadequate. Sooner or later the frond end maker will be confronted with requirements from parts of GCC that are simply not documented anywhere and it is only the GCC developers that know. Most material is very superficial, and the most frequent comment is 'look at the source code files x, y, and z for more information'. The source code file is a mess of macros that one has to go deep in order to understand the outter layers. Instructions are not analytical (most of them say 'just place X and Y file in there' or provide functions a, b and c) without saying why. Obscure names 'like 'yylex()' and stuff don't really help.

    And I don't need lessons on yacc and bison. I know very well how to write a compiler (scanner->parser->AST->intermediate language->assembly). My problem is how to apply that knowledge to GCC, because I don't want to re-invent the wheel.

    When I say it is inadequate, I mean about myself. I don't have the time nor the appetite to read, decode and analyse line per line the work done by others, just because the is no decent documentation.

  81. Also, not a "quality" comparison by Digital_Quartz · · Score: 1

    While we're picking appart semantics...

    You can't really measure "quality" with a benchmark. This is really a performance comparison of compilers, rather than a quality one.

    Quality is usually defined as the number of delivered defects in a product, in this case the compiler. The only "quality" measurement comes from the fact that one of the produced executables generated a segfault. We have identified a single fault in one of the compilers. This is hardly an adequate sample size to determine the relative quality of either.

  82. Which front end? by krischik · · Score: 1

    Just out of curiosity: Which language where you actualy planning for?

    1. Re:Which front end? by master_p · · Score: 1

      I don't want to migrate an existing language to GCC. I want to make my own.

  83. Re:What about documentation to write new front end by Haeleth · · Score: 2, Informative

    Obscure names like 'yylex()' and stuff don't really help.

    And I don't need lessons on yacc and bison.


    I think you probably do need lessons on yacc and bison, if you think "yylex()" is an obscure name. It's the totally standard name for the lexer callback used in yacc and most of its clones. And the relevant section of the Bison manual is the third hit when you google for it -- so much for "no decent documentation"!

    Methinks you could have chosen a better example...

  84. Re:What about documentation to write new front end by ctid · · Score: 2, Insightful

    If you don't want to mess with back-ends etc, why not get your program to spit out C code? Then compile that with gcc. I think that SmallEiffel started out this way.

    --
    Reality is defined by the maddest person in the room
  85. Why so anal? by Fallen+Andy · · Score: 1

    Hey. I'm going to be real honest here. We're all techies right? You would last 5 us or less (and yes that is microseconds) if GCC was a crap compiler. RMS wouldn't forgive you. Your mother wouldn't forgive you. Shit. Don't even think of what Eric (the raymond) would do. He packs serious firepower (cowers under pine tree - hey at 2000+ miles even he can't hit me unless he really did get that tactical nuke). But, we know that the demons we love don't work this way. Honest. (checks the tactical nuke indicator ). Foo. Get a life. Or even an interest in something like Python. GCC is about the most seriously good compiler out there. It may not always make the most pretty code. It may not be friendly. But damn it. You know that if it breaks you can talk to the guy who (god help him or her) broke it. You'll never get that luxury with (cough) that compiler that is called CL. If you need to understand what OSS is. I just told you. Is it the best? Hey if you need to shave that extra something out then you ought to consider the quaint old fashioned roll up my sleeves assembly approach. Coughs and splutters (should really give up smoking) ---- I don't understand children that are scared off this stuff. It wasn't bad for my (oh serious pain in my chest here) H E A L

  86. Amen. by Fallen+Andy · · Score: 1

    But when RMS started his idea for the GNU project none of us believed he was anything except a hippy wacko. Honest. Without *his* input there would be no Linux, No GCC , No EMACS (some might like this) and lord knows how many businesses couldn't have existed. Before Richard , software could cost so much you'd have to sell your grandmother. Don't ask the price of a Fortran or C compiler. Yes. This was the world of 1990. Not 1890. We owe a great debt to Richard. I for one have a fund specifically aimed at Beer for said people. One day, I hope to buy RMS a brewery....Hey, it's going to take some time but I figure that with a few helpful souls we could imagine doing this... A very long time ago a guy called P.J.Brown wrote a delightful book about software development that suggested that if you offered your customers a beer when they discovered a bug then they'd be motivated to find bugs. Don Knuth has a similar view with Latex (sorry about the absent subscript) I like such people. Hey I'm a techie. Gosh I'm running (or is that ruining) a company. Ouch. Honestly, there is no reason to get emotional about compilers. I used to have a friend who spat this stuff in his sleep (and yes, he came back from meeting Nicky in Zurich with a very big smile on his face). I have to say that in the real big wild west out we live in it doesn't matter. GCC is a good compiler. Period. It was a damn good C compiler even when it was 2.x.something. C++ (sigh). You want to play with that shit? Sorry, at CMU, who should know doesn't really like using it. Above all, (and since it's been a long time and most of you perhaps don't know) *DON"T PANIC*. Yes, the hitchhikers guide is back *tomorrow* on our very much beloved BBC. Have fun /.ers. (don't slashdot them or I send my Greek friends Italian friend who may or may not work for those nice italian business people around to rearrange your furniture).

  87. A really stupid comment. by Fallen+Andy · · Score: 1

    I have to make this really stupid comment.
    If I don't nobody else will. I once had the honour
    and priviledge of working with someone who lived
    and breathed compiler technology. It was a long time
    ago. It was Modula-2. So what? It was TDI (yes, those
    people in the old Atari ST days).

    Now, my friend was a serious deep thinking man. When
    he came back from meeting Professor Wirth (yes that
    guy at ETHZ) he smiled a lot. You see, my old friend
    Mr. P.C. (not joking those *are* his initials) managed to do some very very pretty things for the code generation of the compiler we had from those
    splendid swiss people. John Coltrane would love
    that name though...

    Foo. You people are mere virgins. GCC is a good
    compiler. Period. But that's like saying that
    my light is a good illumination source. Doesn't help. If you're so desperate are you in fact asking the wrong question?

  88. Re:What the heck with compile times? by Anonymous Coward · · Score: 0
    So what, 4.0 will be even slower? Great news. NOT!
    Posts like these demonstrate the need for a new Moderation option: -1, Stuck in the 80s.
  89. Re:What about documentation to write new front end by master_p · · Score: 1

    I know 'yylex' is a standard name of yacc. I just said that it is not descriptive enough of its function. It takes time to get used to it...that's a case with a lot of things regarding GCC. It feels like a hack; it's not a hack, but it makes the life of a newbie more difficult than it should be.