GCC > MSVC 6 ?

Started by
26 comments, last by Russell 20 years, 6 months ago
Everyone always says how gcc is slower than the MS or Intel compilers. I assumed that even MSVC 6 would be better than the newest gcc, but it appears that assumption might have been wrong. I benchmarked my chess program using both, and gcc was a hair faster (about 1%). I used -O2 for gcc. Anyone else have a similar experience? Or is this one test a fluke?
Advertisement
It really depends on your programming style, and a myriad of other factors. In general, MSVC++''s optimizing compiler (available on the Pro and Enterprise versions of MSVC++) is faster than gcc, at least in Release mode.

You mentioned using -O2 for gcc--what settings did you use for MSVC 6?

How appropriate. You fight like a cow.
I tried quite a few. The default release settings, and just about every combination of customized optimization settings that are available.

BTW, how does it depend on one''s programming style?
If you need mostly integer optimizations, GCC (3.x) is extremely good at performing them (I don''t know about the newest release of Intel''s C Compiler, but GCC used to out-optimize 6.0 in a lot of hashing algorithms and such). Floating point optimizations still need some work for IA-32 as far as I''m aware, so other optimizers may handle them better. GCC is as good as any compiler at simple optimizations (function inlining, loop unrolling, all of that).

Since you mentioned a chess program, it leads me to believe that you''d be needing light integer optimizations and various generic optimizations, which GCC handled just fine.

GCC rocks!!
Seriously I''ve been using it for some time and it only seems to get better.. MicroSoft is too busy with .NET, longhorn, and other things which is why I very much doubt they care about optimizing your C/C++ code now or making the compiler any better.. They know you''ll use it even if it''s slower, because it''s made by MicroSoft..
if anything they''ll purposely make it suck worse, so you''ll feel the need to use .NET
Isn''t the new MSVC(7) all about .NET? I wonder why?
Another conspiracy to add to the list?
quote:Original post by Anonymous Poster
Another conspiracy to add to the list?

Yes. Anonymous Posters are actually "stupid bombs" sent from Mars to infect us all with stupid.

How appropriate. You fight like a cow.
quote:Original post by Anonymous Poster
GCC rocks!!
Seriously I''ve been using it for some time and it only seems to get better.. MicroSoft is too busy with .NET, longhorn, and other things which is why I very much doubt they care about optimizing your C/C++ code now or making the compiler any better.. They know you''ll use it even if it''s slower, because it''s made by MicroSoft..
if anything they''ll purposely make it suck worse, so you''ll feel the need to use .NET
Isn''t the new MSVC(7) all about .NET? I wonder why?
Another conspiracy to add to the list?

Regardless of how many other things Microsoft is juggling at once, I don''t think any really affects the others. They have a compiler group, and they just work on the compiler. If they decide to embark on something new like web search engines or new versions of Windows, then (suprise!) the compiler group keeps right on working on the compiler.

Regarding my program, yes, it''s pretty much all integer operations. I think I cast a few things to float so they look nice and pretty when displayed
Which version of gcc? 3.2+ is pretty good at optimizations, even 2.95 wasn''t bad. You have to have the professional version of MSVC (or better) to get optimized builds.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
I''m not sure which version of gcc. I''ll check when I get home (at work at the moment). It''s whatever came with cygwin when I downloaded it a couple months ago (I think). And it was MSVC 6 pro.
Actually my engine is a little faster when compiled with GCC 3.3 than with MSVC++ 2003 (release mode). Not very much, perhaps 1 or 2%, but still. And it's mostly floating point. I guess it really depends on the specific piece of code, but GCC is definitely not bad.

Edit: Ah no, correction: it was GCC 3.2 under Windows.


[edited by - Yann L on October 9, 2003 8:47:22 PM]

This topic is closed to new replies.

Advertisement