关于VC2008的编译优化功能:有没有部分不优化的方法
VC的优化做的很不错,如选择"最大化速度(/O2)"的时候如下一段代码
int a=0xC6;void CEncodeTestDialog::OnBnClickedButton1(){ int b=::rand(); if(a>b) { ::MessageBoxA(0,"jj","kkk",0); }}int a=0xC6;void CEncodeTestDialog::OnBnClickedButton1(){ int b=::rand();00401390 E8 6E CC 01 00 call rand (41E003h) if(a>b)00401395 3D C6 00 00 00 cmp eax,0C6h 0040139A 7D 14 jge CEncodeTestDialog::OnBnClickedButton1+20h (4013B0h) { ::MessageBoxA(0,"jj","kkk",0);0040139C 6A 00 push 0 0040139E 68 C0 7E 43 00 push offset string "kkk" (437EC0h) 004013A3 68 C4 7E 43 00 push offset string "jj" (437EC4h) 004013A8 6A 00 push 0 004013AA FF 15 D0 24 43 00 call dword ptr [__imp__MessageBoxA@16 (4324D0h)] }#pragma optimize( "", off )...#pragma optimize( "", on )