Board index » cppbuilder » The best C++ compiler (not the IDE)

The best C++ compiler (not the IDE)


2005-03-28 02:51:22 PM
cppbuilder20
gcc, Dev-C++, Intel C++, Watcom, BCB, VC++, . . ., are some of the C++
compilers that I know by name. I'm sure there are many more.
How can we compare a particular C++ compiler with others?
What would be the sets criterions?
Is there any "commonly accepted" comparison metrics and how the above
mentioned (and many more) compilers score on this comparision?
How the BCB's compiler would score compared to others?
(optimistically/unrealistically assume that BCB still an acceptable product
on the market)
 
 

Re:The best C++ compiler (not the IDE)

<Flienxy>writes:
Quote
gcc, Dev-C++, Intel C++, Watcom, BCB, VC++, . . ., are some of the C++
compilers that I know by name. I'm sure there are many more.

How can we compare a particular C++ compiler with others?
What would be the sets criterions?
Standard compliance
Compilation speed
Executable speed
Executable size
Quality of diagnostic messages
"peripheral" products (such as vendor-specific tools) they come with
...
Quote
Is there any "commonly accepted" comparison metrics and how the
above mentioned (and many more) compilers score on this comparision?
There used to be various of them comparing Standard
compliance. Nowadays everybody (with a few exceptions ...) more or
less complies, so they seem to have vanished.
Quote
How the BCB's compiler would score compared to others?
(optimistically/unrealistically assume that BCB still an acceptable
product on the market)
Its best point is certainly the peripheral products (VCL).
 

Re:The best C++ compiler (not the IDE)

<Flienxy>wrote in message news:4247a971$ XXXX@XXXXX.COM ...
Quote
gcc, Dev-C++, Intel C++, Watcom, BCB, VC++, . . ., are some of the C++
compilers that I know by name. I'm sure there are many more.

How can we compare a particular C++ compiler with others?
What would be the sets criterions?
Is there any "commonly accepted" comparison metrics and how the above
mentioned (and many more) compilers score on this comparision?
You could look at boost.org and see the results of their tests.
I would say in general that the higher a compiler's ranking is
using boost, the higher its standard conformance is, though
this is probably a rule of thumb at best.
Quote
How the BCB's compiler would score compared to others?
(optimistically/unrealistically assume that BCB still an acceptable product
on the market)
BCB scores less than say VC++ but it depends on what you
think of as important. VC doesn't have VCL for example.
 

{smallsort}

Re:The best C++ compiler (not the IDE)

"Duane Hebert" < XXXX@XXXXX.COM >writes:
Quote
>How can we compare a particular C++ compiler with others? What
>would be the sets criterions? Is there any "commonly accepted"
>comparison metrics and how the above mentioned (and many more)
>compilers score on this comparision?

You could look at boost.org and see the results of their tests.
But take them with a grain of salt.
For certain compilers (most notably Visual C++ 6), the tests show
rather how much work the library boosters did to work around the many
deficiencies in that compiler.
Any test suite that causes Visual C++ 6 to score higher on Standard
compliance than BCB6 is a joke.
 

Re:The best C++ compiler (not the IDE)

"Thomas Maeder [TeamB]" < XXXX@XXXXX.COM >wrote in message news: XXXX@XXXXX.COM ...
Quote
"Duane Hebert" < XXXX@XXXXX.COM >writes:

>>How can we compare a particular C++ compiler with others? What
>>would be the sets criterions? Is there any "commonly accepted"
>>comparison metrics and how the above mentioned (and many more)
>>compilers score on this comparision?
>
>You could look at boost.org and see the results of their tests.

But take them with a grain of salt.

For certain compilers (most notably Visual C++ 6), the tests show
rather how much work the library boosters did to work around the many
deficiencies in that compiler.
I thought that I implied as much. Besides, MSVC6 is not very current.
Quote
Any test suite that causes Visual C++ 6 to score higher on Standard
compliance than BCB6 is a joke.
It doesn't look to me that MSVC6 scores higher than BCB6
but of course I agree that part of this has to do with the work
of the guys at boost. But I think that looking at the part
marked "broken" should give some clue.
BTW do you know of any better resources for the OP?
I would think Comeaux is the most compliant, VC7.1 the
next. After that, I'm not sure.
As I also mentioned, there are factors beside compliance that
may be important. I noted reliance on VCL but I would also
add that an actively supported compiler would probably be
preferable as well. Additionally, for me, the ability to use
boost libs would rank near the top.
 

Re:The best C++ compiler (not the IDE)

<Flienxy>writes:
Quote
How can we compare a particular C++ compiler with others? What
would be the sets criterions? Is there any "commonly accepted"
comparison metrics and how the above mentioned (and many more)
compilers score on this comparision? How the BCB's compiler would
score compared to others? (optimistically/unrealistically assume
that BCB still an acceptable product on the market)
There are compliance test suites which can give compilers a score on
how well they adhere to the standard specification. There are
benchmarks that can test how good the runtime performance is of the
generated code. You can look at the size of the resulting executable,
after taking reasonable efforts to eliminate debugging symbols, use
similar linking strategies, and other size-related stuff) to compare
the compactness of the generated code.
Different categories may have different winners, and there aren't any
single industry-standard tests for any category.
--
Chris (TeamB);
 

Re:The best C++ compiler (not the IDE)

Duane Hebert wrote:
Quote
It doesn't look to me that MSVC6 scores higher than BCB6
but of course I agree that part of this has to do with the work
of the guys at boost. But I think that looking at the part
marked "broken" should give some clue.
It certainly has done at various points. Note that there are also
workarounds in place for BCB at Boost as well. The reason VC6 scores
so well is that when you find a workaround techniquue it is fairly
stable. Borland swallows more of the standard in the first place, but
does not handle corner cases so well. Switching to a different
implementation technique usually stresses different corner cases. Boost
tests are very good at stressing corner cases.
Quote
BTW do you know of any better resources for the OP?
I would think Comeaux is the most compliant, VC7.1 the
next. After that, I'm not sure.
I would guess at Intel, as that uses the same EDG front end that Comeau
uses, while switching off a couple of features to help maintain VC
compatibility. In particular, the export keyword is not available, and
I am not sure about 2 phase lookup for templates.
Metrowerks also implement 2 phase lookup, something MS have said they
have no current plans to implement, although I have no exhaustive
comparison on the rest of the language to see how they compare. My gut
says they might be ahead.
Apparently GCC added 2 phase lookup for v3.4 and is pushing {*word*156}
some compliance issues. I am still using 3.3 for testing, and suspect
VC7.1 has a slight edge over this version.
I have not looked at any of the other Windows compilers recently enough
to give a fair rating - they were all a long way off last time I
checked.
Note: there are generally 2 areas that stress current implementations
still. 'Corner case' template use (export keyword, 2 phase lookup) and
the preprocessor. The latter passes a lot of people by, until they get
serious about any pre-processor metaprogramming, when you suddenly
discover how hard it is to write portable code past all the buggy PP
implementations out there. There appears to be very little interest in
improving PP conformance either - no-one wants to encourage greater use
of teh PP in C++!
AlisdairM(Teamb)
 

Re:The best C++ compiler (not the IDE)

Dear all,
I think the 3 most important aspect of a C++ compiler are:
Standard conformance.
Executable performance.
Executable size.
For standard conformance, there is a test suit from ISO/ANSI which can be
used for testing. Currently, GCC should perform the best and following VC++
7.1. Because of the age of BCB 6, it really behinds the standard (mainly in
template implementation).
For executable performance, GCC and VC++ 7.1 is head to head in the top.
For executable size, I have no information or experience on it.
When consider about the tools shipping with the compiler, VC++ and
MetroWork's C++ compiler seems to win the race.
When consider about the ease of use in Window programming, BCB wins.
Regards,
Keith Lai.
 

Re:The best C++ compiler (not the IDE)

"Lai Chi Wai" < XXXX@XXXXX.COM >writes:
Quote
Dear all,

I think the 3 most important aspect of a C++ compiler are:
Standard conformance.
Executable performance.
Executable size.
I agree, however it's usually the case that performance comes at the
cost of executable size. For example, there are compiler
optimizations for creating classes where the complier writes 3 or 4
versions of your constructor in the executable, with each being
optimized for different scenarios (even though your source code only
has one constructor.) For example, if your class uses virtual
inheritance, the difference may be whether your class's constructor
should initialize the virtual base first or not. Thus, when the
actual type of an instance is your derived type, it uses one generated
constructor. If the actual type of an object derives from your
derived class, the generated code may use another constructor, etc.
These types of things happen in many situations, and rarely can happen
together, except if it's eliminating dead code and factoring out
common code. (Though factoring out common code may slightly slow down
the runtime too, unless it decreases the pages to where the program
code fits better without being moved in memory, etc. It's a very
complicated issue!)
Quote
For executable performance, GCC and VC++ 7.1 is head to head in the top.
I'm not sure about that. I'd wager that Intel produces better code
than either in terms of performance. On AMD64, for example, GCC is ok
but other compilers are much better. For example, the pathscale C++
compiler claims to generate code up to 40% faster than GCC.
Quote
For executable size, I have no information or experience on it.
Me neither. But fortunately, memory is cheap and this isn't an
issue. If I were working on an embedded system or in a limited memory
environment, obviously the importance goes up.
Quote
When consider about the tools shipping with the compiler, VC++ and
MetroWork's C++ compiler seems to win the race.
A good linux distribution has a pretty complete set of
tools... probably more than any other package to be found!
Quote
When consider about the ease of use in Window programming, BCB wins.
I agree here, with the provision that your code doesn't push the
cutting edge of C++ compliance, or BCB may become a challenge to use.
--
Chris (TeamB);
 

Re:The best C++ compiler (not the IDE)

"Doug Tinkham" < XXXX@XXXXX.COM >writes:
Quote
"Alisdair Meredith" <alisdair.meredith@ XXXX@XXXXX.COM >
wrote in message news: XXXX@XXXXX.COM ...
>
>I have not looked at any of the other Windows compilers recently enough
>to give a fair rating - they were all a long way off last time I
>checked.

What about the Digital Mars compiler? Does anyone have a feeling for how it
rates in standards compliance and executable speed?
Sorry, I've never used it or talked with anyone who has. (Or, if I
have talked to someone who happened to have used it, we talked about
something else and their secret was never revealed.)
--
Chris (TeamB);
 

Re:The best C++ compiler (not the IDE)

"Alisdair Meredith" <alisdair.meredith@ XXXX@XXXXX.COM >
wrote in message news: XXXX@XXXXX.COM ...
Quote

I have not looked at any of the other Windows compilers recently enough
to give a fair rating - they were all a long way off last time I
checked.
What about the Digital Mars compiler? Does anyone have a feeling for how it
rates in standards compliance and executable speed?
Thanks
 

Re:The best C++ compiler (not the IDE)

"Chris Uzdavinis (TeamB)" < XXXX@XXXXX.COM >wrote in message
Quote
Sorry, I've never used it or talked with anyone who has. (Or, if I
have talked to someone who happened to have used it, we talked about
something else and their secret was never revealed.)

--
Chris (TeamB);
I'm going to check it out when my CD arrives. I have heard/seen that it is a
very fast compiler, even faster than bcc 5.6 (without pre-compiled headers I
think), for whatever that is worth.
Doug
 

Re:The best C++ compiler (not the IDE)

Alisdair Meredith <alisdair.meredith@ XXXX@XXXXX.COM >wrote:
Quote
[...]
>BTW do you know of any better resources for the OP?
>I would think Comeaux is the most compliant, VC7.1 the
>next. After that, I'm not sure.

I would guess at Intel, as that uses the same EDG front end that Comeau
uses [...]
So would I.
Quote
Metrowerks also implement 2 phase lookup, something MS have said they
have no current plans to implement, although I have no exhaustive
comparison on the rest of the language to see how they compare. My gut
says they might be ahead.
Regarding compliance CW9 and VC71 are pretty
much the same /except/ for two-phase lookup,
which, to me, gives CW a big advantage. (I
recently have done a lot of stuff on the Mac,
where I have CW's two-phase lookup, even
though I hate haveing to use the mouse all
the time. Finding bugs in template code
earlier was worth the hassle.)
VC71 accepting a lot of code with missing
'typename' (or 'template') is another big
hassle. Whenever I port, these steal a lot
of my time.
Quote
Apparently GCC added 2 phase lookup for v3.4 and is pushing {*word*156}
some compliance issues. I am still using 3.3 for testing, and suspect
VC7.1 has a slight edge over this version.
For us GCC3 finds a lot of bugs that slip
through VC71 and CW9. (Mostly in the area of
two-phase lookup and missing 'typename' or
'template' in definitions and calls.)
However, as we rarely ever write anything
new using GCC, but rather only port to it,
this doesn't necessarily mean, GCC is better.
While it finds errors that the other ones
overlook, there might be even more errors
it overlooks which the other ones would
find -- only we never have a scenario where
we would run into those.
Quote
[...]
AlisdairM(Teamb)
Schobi
--
XXXX@XXXXX.COM is never read
I'm Schobi at suespammers dot org
"The presence of those seeking the truth is infinitely
to be prefered to those thinking they've found it."
Terry Pratchett
 

Re:The best C++ compiler (not the IDE)

Doug Tinkham < XXXX@XXXXX.COM >wrote:
Quote
"Alisdair Meredith" <alisdair.meredith@ XXXX@XXXXX.COM >
wrote in message news: XXXX@XXXXX.COM ...
>
>I have not looked at any of the other Windows compilers recently enough
>to give a fair rating - they were all a long way off last time I
>checked.

What about the Digital Mars compiler? Does anyone have a feeling for how it
rates in standards compliance and executable speed?
Walter has often stated that he emphasizes
compilation speed over std compliance. He
plainly disses some std C++ features as he
considers them not useful enough compared
to the pain they make implementors.
Quote
Thanks
Schobi
--
XXXX@XXXXX.COM is never read
I'm Schobi at suespammers dot org
"The presence of those seeking the truth is infinitely
to be prefered to those thinking they've found it."
Terry Pratchett
 

Re:The best C++ compiler (not the IDE)

Lai Chi Wai < XXXX@XXXXX.COM >wrote:
Quote
Dear all,

I think the 3 most important aspect of a C++ compiler are:
Standard conformance.
Executable performance.
Executable size.

For standard conformance, there is a test suit from ISO/ANSI which can be
used for testing.
I have never heard about such a test suite
being provided by the std committee. I think
you are mistaken.
Quote
Currently, GCC should perform the best and following VC++
7.1.
Here you're definitely mistaken. EDG-based
compilers, foremost Comeau, are generally
accepted as the most compliant compilers.
Comeau + Dinkumware Std Lib is probably the
closest you can get to the standard.
Quote
Because of the age of BCB 6, it really behinds the standard (mainly in
template implementation).
With this I agree.
Quote
For executable performance, GCC and VC++ 7.1 is head to head in the top.
GCC? I wouldn't know about that, but I am
not sure. (I would surely expect Intel's
compiler to be among the best on Intel
platforms.)
Quote
[...]
Keith Lai.
Schobi
--
XXXX@XXXXX.COM is never read
I'm Schobi at suespammers dot org
"The presence of those seeking the truth is infinitely
to be prefered to those thinking they've found it."
Terry Pratchett