commercial c compilers vs free c compilers

Discussion in 'C Programming' started by geletine, Jul 2, 2006.

  1. geletine

    geletine Guest

    what are the benefits in using commercial compilers like intel,
    greenhill or portland compared to free c compiles like gcc, lcc, tcc,
    TenDRA, sun and others?
     
    geletine, Jul 2, 2006
    #1
    1. Advertisements

  2. geletine

    Tim Prince Guest

    <mostly non-topical> As we have no idea of your interests, potential
    benefits may not be meaningful in your projects.
    More than one of these commercial compilers is more efficient about
    vectorization, although gcc is closing the gap.
    <totally OT>There are more Windows style extensions in commercial
    compilers, some supported on linux as well. Your chances of getting
    help on those are limited to the vendors' support arrangements.
    Commercial compilers incur certain obligations to support you in problem
    resolution; for some of the free compilers, you could enter into a
    support contract which might be more effective. Short of that,
    depending on the community may or may not get you quick assistance.
     
    Tim Prince, Jul 2, 2006
    #2
    1. Advertisements

  3. geletine

    Malcolm Guest

    I use a commerical Microsoft compiler at home, because I need the libraries
    and the tools to write GUI programs.
    I use free compilers at the university because I don't do much graphical
    programming, everything has to be portable, and a lot of academic code is
    released to compile under GNU.

    There are many considerations, such as efficiency of source, quality of
    tools, whether the compiler vendor is legally liable for problems in the
    compiler, support. The cost of buying the compiler is just one of these
    factors, and often not a very important one.
     
    Malcolm, Jul 2, 2006
    #3
  4. geletine

    Ian Collins Guest

    As other have said, it depends on you circumstances.

    I used a commercial compiler (Sun, now free) because I preferred the
    tools and performance improvements it provides.

    Support is another strong driver for commercial products.
     
    Ian Collins, Jul 2, 2006
    #4
  5. geletine

    geletine Guest

    interesting points, i was too vague , i will be programming mostly
    command line apps, the odd bit of gtk or qt gui programs on unix type
    systems, looking at ghs markets from their website, the companies all
    seem financially capable of buying ghs products, so ghs prices there
    products accordingly, there seem to be concentrated on embedded
    devices, which i am sure gcc is quite scalable, i know its not the
    fastest c compiler,as already mentioned in this thread, but gcc does
    accept inline asm. It would be interesting to see what critical
    software has been compiled with gcc, out of curosity. Portland and
    intel on the other hand seem to cater for the opposite crowd.

    Intel have the advantage that they created the chips for which their
    compilers are to be used, so i expect them to be the fastest, if their
    compilers are intel centric, that means there won;t be any real benifit
    to amd users..

    thanks
     
    geletine, Jul 2, 2006
    #5
  6. If GCC is adequate for your needs, then you should consider the performance
    differences, the peripheral tools provided, and the cost of a support
    contract vs. using Cygnus for GCC. Like many things in life, a product with
    a lower acquisition cost can cost you a lot more in the end -- or it can be
    a great deal.

    If you need your code to work on several different architectures, you're
    going to have a hard time finding any compiler that handles that as well as
    GCC, even though it's rarely the best available on any one particular
    platform. If you only care about one platform (and are sure you'll never
    need to port your code), GCC is probably not your best bet.
    "Critical" is, of course, in the eyes of the beholder. Virtually all of the
    critical Internet infrastructure is compiled with GCC, from web servers to
    email servers to DNS servers and all the way down to the routers that move
    all the bits around. It's only on the desktop and corporate server farms
    that you find much stuff compiled with other compilers.

    (Note that I don't know for sure about marketshare for embedded stuff, but
    Cygnus makes their money porting and supporting GCC for embedded systems,
    and every company I've worked at uses GCC for their embedded products)
    It's been well documented that Intel's compilers emit code that tests what
    brand of chip you're using and selects a significantly slower code path for
    non-Intel chips. If you patch that test out of your executables, they
    typically run significantly faster on AMD chips than on Intel ones --
    despite being optimized only for Intel's chips.

    S
     
    Stephen Sprunk, Jul 3, 2006
    #6
  7. geletine

    Morris Dovey Guest

    geletine (in )
    said:

    | It would be interesting to see what critical software has been
    compiled with
    | gcc, out of curosity.

    I've written C used to control multicast networking for a stock
    exchange, participated in development of a SoC cable modem product
    (first order received was for 10000000 units!), and participated in
    development of firmware for household appliances for a manufacturer
    whose claim to fame was product reliability - all using gcc.

    | Intel have the advantage that they created the chips for which their
    | compilers are to be used, so i expect them to be the fastest, if
    | their compilers are intel centric, that means there won;t be any
    | real benifit to amd users..

    I'm unclear as to whether you're referring to compiler speed or speed
    of execution of the compiled program. I've never much worried about
    compiler speed; and gcc does a decent job of producing fast, compact
    executables.

    Performance (on both sides) seems more dependent on the expertise of
    toolchain producer than on anything else.

    A long time ago I wrote several thousand line program in Fortran that
    had horrible spaghetti execution paths (with computed goto's,
    arithmetic if, logical if, fuctions, etc) and did quite a bit of real,
    integer, and mixed mode calculation - all to produce a single
    one-digit numeric result. The compiler churned away for more than a
    half hour and emitted three lines of assembly code. The first line did
    a load register immediate with '7' (0x37, the correct result in
    character form), the second line did a _branch_ to the resident
    printer output routine, and the third line was 'END'. The program
    would, as you might expect, exit when the printer routine executed its
    RET instruction; and the system would flush the print buffer
    automatically.

    Would you call that a fast compiler or a slow compiler? [ It was DG
    Fortran 5 if you're curious. ]
     
    Morris Dovey, Jul 3, 2006
    #7
  8. These days, on x86, gcc is /fast/.
    All of linux and the BSDs are compiled with gcc - meaning "all"
    the critical database,mail,web servers are compiled with gcc.

    I know quite a few telecom systems running on said OSs that's
    compiled with gcc too.
     
    =?ISO-8859-1?Q?=22Nils_O=2E_Sel=E5sdal=22?=, Jul 3, 2006
    #8
  9. geletine said:
    The usual arguments are "support" and "liability". In practice, you're very
    unlikely to be able to make a liability claim stick. As for support, well,
    call me Mr Cynical if you like but I have not noticed a huge level of
    support for commercial compilers over and above that of free compilers.
    Indeed, gcc is probably /better/ supported than Visual C, in terms of the
    average speed of problem resolution.
     
    Richard Heathfield, Jul 3, 2006
    #9
  10. I should perhaps add that a optimizing compiler is no substitute
    for a good programmer - and often it's the speed of the programmer that
    matters :)
     
    =?ISO-8859-1?Q?=22Nils_O=2E_Sel=E5sdal=22?=, Jul 3, 2006
    #10
  11. geletine

    Ben C Guest

    The fact that gcc is free software and so widely used means all the
    information you might need is widely available-- from manuals and HOWTOs
    to forums, countless web articles, and ultimately the source code
    itself. When it comes to troubleshooting problems, all this can be more
    effective than a support engineer or two at the other end of a contract
    for proprietary software.
     
    Ben C, Jul 3, 2006
    #11
  12. geletine

    geletine Guest

    I'm unclear as to whether you're referring to compiler speed or speed
    I meant execution speed, after all the end user cares about how well
    the application runs, not the development time.

    There has been some effort to build the freebsd kernel using tendra for
    license reasons alone.
    What advantage does intel have in purposely slowing excutable code on
    non-intel chips? Apart from getting developers to change chips, which
    is not a solution in itself. It just sounds cynical to me.
    I could not agree more, its not uncommon to see code that is written in
    c or any hll that runs faster than assembly.
     
    geletine, Jul 3, 2006
    #12
  13. geletine

    santosh Guest

    geletine wrote:

    Don't snip the attribution lines. It's not clear at all whom you're
    quoting below. You've attached your post to Richard Heathfield's but
    you seem to be quoting text from Stephen Sprunk's post up-thread. In
    future, please preserve attributions and attach your post to the person
    you're replying to.
    For the majority of programs, under x86, GCC is fast enough. Intel's
    compiler might out-do it, especially with programs heavy on floating
    point and math, but the portability and ease of use offered by GCC are,
    in most cases, more important.
    Since when have commercial corporations played fair and nice. Intel's
    counterpart on the software side is a notorious example :)
    This would differ on a case-by-case basis, especially depending on the
    skill of the programmer writing the assembly code. Amateur assembly is
    often worse, (in terms of performance), than amateur C.
     
    santosh, Jul 3, 2006
    #13
  14. geletine

    geletine Guest

    sorry, it does look confusing, after i posted it, espcially if this
    post becomes a long one.
    agreement met :)
    Does the gates foundation , the Susan Thompson Buffett Foundation or
    Mark Shuttleworth contributions count ?
    Even very good c code can be difficult to optimise in asm.
    Randall hydes , a asm advocate article
    "Levels of Optimization"
    http://webster.cs.ucr.edu/Articles/GreatDebate/index.html
    explains the famous Berkeley string package and how well its
    optimised..
     
    geletine, Jul 3, 2006
    #14
  15. geletine

    santosh Guest

    Oh God! Never mind, maybe someday, you'll get it.
    The personal descisions of these people have nothing to do with the
    business policies of their companies. The former cannot be used as a
    means to condone the malpractise of the latter.

    .... snip ...
    Yes, and you should probably take any further discussions of assembly
    vs. C to alt.lang.asm, comp.compilers or similar groups.

    PS: Randall Hyde is a "regular" in alt.lang.asm, so you might want to
    take up this debate with him. I'm sure he'll have tons to say on this
    subject. :)
     
    santosh, Jul 3, 2006
    #15
  16. geletine

    geletine Guest

    thats true,
    ive read his post for some time, ive posted a few times in the
    alt.lang.asm newsgroup, i was not meant to talk about asm, alot of
    discussions tend to land on asm when discussing performance of c
    compilers.

    To sum up , most think that open source compilers are better technially
    as well as friendlier support, which i have myself experienced in the
    past, where something that does not compile on gcc and the help is
    availiable within hrs if not minutes.

    thanks
     
    geletine, Jul 3, 2006
    #16
  17. geletine

    dbtid Guest

    Malcolm wrote:
    What is "efficiency of source?"
     
    dbtid, Jul 3, 2006
    #17
  18. They don't care if the _developers_ change chips; ICC itself runs just as
    fast on AMD as Intel. What they care about is _users_ changing; they want
    Intel chips to run code faster than AMD chips in performance tests, and if
    the only way to do that is to deliberately make the code run slower on AMD
    chips, that's what they'll do.

    Personally, I'd prefer Intel make their chips faster instead of resorting to
    such dirty tactics to fight AMD, but playing compiler games certainly costs
    them a lot less R&D money...
    No, the point was that a good programmer with a bad compiler will produce
    faster code in the end than a bad programmer with a good compiler. At best,
    a better compiler lets your programmers spend less time worrying about
    low-level optimizations and more time worrying about using the right
    algorithm (or playing with something like VTune).

    S
     
    Stephen Sprunk, Jul 4, 2006
    #18
  19. It's definitely fast, and it's a lot faster than it used to be, but ICC is
    still faster. Intel has put a lot of effort into ICC, including all of
    GCC's C extensions and compatible command-line flags. It's a drop-in
    replacement for making your code faster on x86, and you don't have to do
    anything other than pay a few bucks for it -- and patch out the brand test
    if you have AMD customers.

    S
     
    Stephen Sprunk, Jul 4, 2006
    #19
  20. geletine

    Malcolm Guest

    Sleepy, hot day and England knocked out of the World Cup.
    I meant efficiency of generated machine code.
    Actually when I did some systematic tests of GCC against a commercial
    compiler about ten years ago, gcc was almost always better, except that at
    the time it didn't do cross-function optimisation.
     
    Malcolm, Jul 4, 2006
    #20
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.