Which is the best C++ compiler?

G++ seems to be the most popular. It's free, portable and quite good. The Windows port (MinGW) was really dated the last time I used it (maybe one year ago).

The Intel C++ compiler is considered as the one which generates the fastest code (however it's known that it generates bad SIMD code for AMD processors). You can use it freely on GNU/Linux under quite restrictive conditions.
I've used it for some time and I liked the fact that it emits clever warnings which others don't.

VC++ is often regarded as the best C++ IDE, and from what I hear the compiler is quite good too. It's free (as in free beer), and only available on Windows of course.
If you are interested in Windows programming I would suggest this compiler, because it's always up-to-date and provides more advanced features for this purpose.

I would suggest VC++ on Windows, G++ for other OSes. Try the free version of I++ yourself, to see if it's worth the money.


Are there documented cases when a compiler produced incorrect output which resulted in a failure of mission-critical software?

Yes, probably, but I'd say that most of the time it's probably the programmer's fault. For example, if someone doesn't know how floating-point arithmetic works, it's easy to write unreliable code. A good programmer must also know what is guaranteed to work by the C++ standard and what isn't. The programmer should also know what are the limits of the compiler, e.g. how well it implements the standard and how aggressively it optimizes.


First of all which platform you are using usually dictates which compilers to use.

Secondly, your question on robustness and performance. I am not sure what you mean by robustness. but if you mean correctness of the compiled binaries, I'd have to say as long as you are using a stable version of any of the compilers you mentioned you are not going to run into "robustness" problems. These compilers are all very mature and have been used in countless real life projects. So I would not worry about robustness at all.

Regarding performance, That is a tough one to answer because each compiler has different optimisation techniques which could theoretically yield different performance. I hope there is someone more knowledgable than me that can tell you about this.

In reality, given that the compilers that you mentioned are all high quality and mature compilers, the questions that you should be asking, are not which compiler is more robust, but:

  • Which is the compiler that supports my target platform
  • Which is the compiler that works well with my development environment and tools?
  • Which compiler is my development team and integrators most familiar with.

The question of optimisation techniques is an open question however, and it is a non trivial question at that. I hope some could shed some light on it.