FIX: Optimization Causes Code Generation Error in a Conditional Statement (236119)
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 Q236119 SYMPTOMS
The optimizer may generate incorrect code for an if statement that contains identical expressions in both conditional statements.
CAUSE
The optimizer makes a mistake when trying to move common sub-expressions to a single location.
RESOLUTION
There are three potential ways to work around this bug: - Turn off global optimization for that function.
- Make the function inline.
- Move the common expression before the if block.
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 Service Pack 4.
Modification Type: | Major | Last Reviewed: | 12/1/2003 |
---|
Keywords: | kbBug kbCodeGen kbfix kbNoUpdate KB236119 |
---|
|