I've looked at the disassembly to some very basic console apps in VC++ and compared the standard disassembly to that of the same program with the optimizations turned on. I must say, they really know what they're doing. Example:
This code
int x, y, *p;
x = 1;
y = 1;
p = &y;
x = x * 3;
*p = *p * 3;
std::cout << x << " " << y;
return 0;
Has the following dissasembly without optimizations:
01371000 push ebp
01371001 mov ebp,esp
01371003 sub esp,0Ch
int x, y, *p;
x = 1;
01371006 mov dword ptr [x],1
y = 1;
0137100D mov dword ptr [y],1
p = &y;
01371014 lea eax,[y]
01371017 mov dword ptr [p],eax
x = x * 3;
0137101A mov ecx,dword ptr [x]
0137101D imul ecx,ecx,3
01371020 mov dword ptr [x],ecx
*p = *p * 3;
01371023 mov edx,dword ptr [p]
01371026 mov eax,dword ptr [edx]
01371028 imul eax,eax,3
0137102B mov ecx,dword ptr [p]
0137102E mov dword ptr [ecx],eax
std::cout << x << " " << y;
01371030 mov edx,dword ptr [y]
01371033 push edx
01371034 push offset ___xi_z+38h (137214Ch)
01371039 mov eax,dword ptr [x]
0137103C push eax
0137103D mov ecx,dword ptr [__imp_std::cout (1372080h)]
01371043 call dword ptr [__imp_std::basic_ostream<char,std::char_traits<char> >::operator<< (1372078h)]
01371049 push eax
0137104A call std::operator<<<std::char_traits<char> > (1371060h)
0137104F add esp,8
01371052 mov ecx,eax
01371054 call dword ptr [__imp_std::basic_ostream<char,std::char_traits<char> >::operator<< (1372078h)]
return 0;
0137105A xor eax,eax
The same code has the following disassembly with optimizations enabled:
int x, y, *p;
x = 1;
y = 1;
p = &y;
x = x * 3;
*p = *p * 3;
std::cout << x << " " << y;
00A91000 mov ecx,dword ptr [__imp_std::cout (0A92050h)]
00A91006 push 3
00A91008 push 3
00A9100A call dword ptr [__imp_std::basic_ostream<char,std::char_traits<char> >::operator<< (0A9203Ch)]
00A91010 push eax
00A91011 call std::operator<<<std::char_traits<char> > (0A91160h)
00A91016 add esp,4
00A91019 mov ecx,eax
00A9101B call dword ptr [__imp_std::basic_ostream<char,std::char_traits<char> >::operator<< (0A9203Ch)]
return 0;
00A91021 xor eax,eax
See what I mean?