FIX: Bad Codegen with /Og and Floating-Point Multiplication Class with Virtual Destructor (170514)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
This article was previously published under Q170514 SYMPTOMS
The Visual C++ 5.0 compiler may generate incorrect instructions when it
encounters floating-point multiplication in a member of a class that has a
virtual destructor.
RESOLUTION
Use one of the following four workarounds: - Use /Op.
- Do not use /Og. Note that /O1, /O2, and /Ox are aggregate optimization
switches that include /Og.
- Use the optimize pragma around the class member to disable the /Og
optimization or to turn on the /Op optimization.
- Make the destructor non-virtual. This may not be an option if the given
class is derived from a class that has a virtual destructor in a library
that you cannot change.
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++ 5.0sp3.
| Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
|---|
| Keywords: | kbBug kbcode kbfix kbVC600fix KB170514 |
|---|
|