Converting a C++ project from Visual Studio 2005 invisibly turns off optimization for the release build. The optimization page of the project properties shows that /O2 is turned on, but the /O2 flag is not passed to the compiler and an unoptimized build results.
This appears to be related to bug 330854 which was closed as fixed in SP1, but now seems to be a symptom of a much more serious underlying problem.
Viewing the 2005 and 2008 .vcproj files, it appears that 2005 left the Optimization setting in VCCLCompilerTool blank for the Release build, and both the property page GUI and the compiler flag generation code interpreted blank as /O2. The conversion to 2008 leaves it blank, but the 2008 property page GUI interprets blank as /O2 and the compiler flag generation code interprets blank as no optimization flag, which is equivalent to /Od.
The workaround is to change the optimization from /O2 to /O1 and back to /O2. This causes an explicit Optimization setting to be written to the .vcproj file.
This bug has potentially massive implications. It's likely that most projects (world wide) converted to 2008 are no longer optimized and no-one realizes this. I only came across it by accident when viewing the generated assembly code for one of my projects and noticed that the supposedly optimized code was very inefficient. Fixing this gave me a 35% performance improvement in a time-critical application.
I just discovered that this bug is worse than I originally thought. You can trigger it with a project that was created in VS 2008, not just one than was converted from 2005. All you have to do is to go to the compiler optimization page for the Release build and select <inherit from parent or project defaults>. On hitting apply, the setting will change from "Maximize Speed (/O2)" in bold to "Maximize Speed (/O2)" unbolded, and the /O2 compiler flag will be deleted.
Basically, if the GUI says Maximize Speed /O2 unbolded, it's lying and the build is unoptimized.