Article ID: 195376 - Last Review: July 5, 2005 - Revision: 1.1 FIX: Incorrect Code Generated with /Og and /Oa or /OwThis article was previously published under Q195376 On This PageSYMPTOMS
The compiler might generate incorrect code when building with /Og (Global Optimizations) and /Oa (Assume No Aliasing) or /Og and /Ow (Assume Cross-function Aliasing).
RESOLUTION
Turn off /Oa and /Ow to work around the bug.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in Visual Studio 6.0 Service Pack 3.
For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base: 194022 (http://support.microsoft.com/kb/194022/EN-US/ ) INFO: Visual Studio 6.0 Service Packs, What, Where, Why 194295 (http://support.microsoft.com/kb/194295/EN-US/ ) HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed MORE INFORMATION
Please refer to Help for more information about the compiler
options /Og, /Oa, and /Ow.
The following sample demonstrates the bug. In this case, the problem appears to be related to the final attempt to access an array in a function when that access involves doubling the variable used to index it. Sample CodeThe program output is: 2.000000. | Article Translations
|
Back to the top
