commercial c compilers vs free c compilers

G

geletine

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?
 
T

Tim Prince

geletine said:
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?
<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.
 
M

Malcolm

geletine said:
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?
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.
 
I

Ian Collins

geletine said:
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?
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.
 
G

geletine

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
 
S

Stephen Sprunk

geletine said:
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.

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

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

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
 
M

Morris Dovey

geletine (in (e-mail address removed))
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. ]
 
?

=?ISO-8859-1?Q?=22Nils_O=2E_Sel=E5sdal=22?=

geletine said:
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
These days, on x86, gcc is /fast/.
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.

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

Richard Heathfield

geletine said:
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?

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

=?ISO-8859-1?Q?=22Nils_O=2E_Sel=E5sdal=22?=

Nils said:
These days, on x86, gcc is /fast/.
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 :)
 
B

Ben C

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.

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

geletine

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.

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

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

I could not agree more, its not uncommon to see code that is written in
c or any hll that runs faster than assembly.
 
S

santosh

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.
I meant execution speed, after all the end user cares about how well
the application runs, not the development time.

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

Since when have commercial corporations played fair and nice. Intel's
counterpart on the software side is a notorious example :)
I could not agree more, its not uncommon to see code that is written in
c or any hll that runs faster than assembly.

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

geletine

santosh said:
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.

sorry, it does look confusing, after i posted it, espcially if this
post becomes a long one.
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.

agreement met :)
Since when have commercial corporations played fair and nice. Intel's
counterpart on the software side is a notorious example :)

Does the gates foundation , the Susan Thompson Buffett Foundation or
Mark Shuttleworth contributions count ?
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.

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

santosh

geletine said:
.... snip ...
sorry, it does look confusing, after i posted it, espcially if this
post becomes a long one.

Oh God! Never mind, maybe someday, you'll get it.
Does the gates foundation , the Susan Thompson Buffett Foundation or
Mark Shuttleworth contributions count ?

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

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. :)
 
G

geletine

santosh said:
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.

thats true,
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. :)

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
 
D

dbtid

Malcolm wrote:
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.

What is "efficiency of source?"
 
S

Stephen Sprunk

geletine said:
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.

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...
I could not agree more, its not uncommon to see code that is written in
c or any hll that runs faster than assembly.

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
 
S

Stephen Sprunk

"Nils O. Selåsdal" said:
These days, on x86, gcc is /fast/.

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
 
M

Malcolm

dbtid said:
Malcolm wrote:


What is "efficiency of source?"
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.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top