FIX: Incorrect Code Generated with /Og Optimization (194608)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
This article was previously published under Q194608 SYMPTOMS
A code sequence similar to the following generates incorrect code when
compiled with global (/Og) optimization:
( ( ConstantValue << Variable ) + OptimizableValue );
RESOLUTION
You can work around this problem by removing global optimization from the
command line or by disabling global optimization on a per-function basis
with the optimize pragma.
Another workaround is to simplify the code and use a temporary global
variable as illustrated in the "More Information" section of this article.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This problem was corrected in Visual C++ version 6.0, Service Pack 3 (SP3).
REFERENCES
service pack 3 sp3
Modification Type: | Minor | Last Reviewed: | 9/23/2005 |
---|
Keywords: | kbHotfixServer kbQFE kbBug kbCodeGen kbCompiler kbfix kbVC600fix KB194608 |
---|
|