Possible optimization bug on manual bounds checking - by 59C4DB0A-7734-4D58-A475-4F3AC3B7DCF8

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 626399 Comments
Status Closed Workarounds
Type Bug Repros 1
Opened 12/1/2010 11:07:07 AM
Access Restriction Public


I found what appears to be an optimization bug in visual studio 2008 and 2010. 
Sign in to post a comment.
Posted by Microsoft on 12/3/2010 at 10:49 AM
Thanks again for reporting this issue! We have a fix in the works which will be incorporated into a future release of Visual Studio.

In the meantime you can workaround this issue in your code by disabling optimizations in the function(s) that exhibits the incorrect behavior. This can be done via the optimize pragma:

#pragma optimize( "", off )
... // function exhibiting incorrect behavior
#pragma optimize( "", on )

More information on how to use this pragma can found here: http://msdn.microsoft.com/en-us/library/chh3fb0k(v=VS.100).aspx

Thanks again for helping us make continuing improvements to our compiler.

VC++ Codegen & Optimization Team
Posted by Microsoft on 12/1/2010 at 6:15 PM
Thanks for your feedback. We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 12/1/2010 at 5:54 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)