Actually, while this does have nothing to do with "tuning for windows",
this is valid argument.
Optimize for size in effect on both sides (means no loop unroling).
Well, I did a lot of things, from playing with options down to comparing
assembly for the same function generated by both compilers. Still there
is huge difference even at that level. Unfortunately.
That is true. My 50% difference came after playing with options for a
while. Originally it was more like 150% (with default size optimization).
And, actually, there is not that much options affecting optimizations in
GCC. Those relevant ones are on using either -O1 or -O2, see this
excelent article about the issue:
http://freshmeat.net/articles/view/730/
Actually, despite being instructed otherwise, I kept playing with
options and for the size optimization, the best set seems to be:
-Os -finline-limit=20 -ffunction-sections
(of course, as long as your linker is able to cope with that).
"inline-limit" couriously makes a huge difference in size.
I turn it on.
Be sure I am.
Now please, this can seem like I despise GCC. No. Just VC++ is at the
moment way better compiler (another issue is compilation speed - VC++ is
2-3 times faster).
It is a pity, imagine how good would be Mac or Linux if it had better
compiler.... But of course, GCC keeps going on, leaving us with hope it
will gradually improve to the level of VC++. But we should not be blind
and think GCC is better just because it is open-source while VC++ is
produced by that evil company....
Mirek