Home Dashboard Directory Help

C++ compiler generates wrong code with optimization flag /O2 by meier19690921


 as Postponed Help for as Postponed

Sign in
to vote
Type: Bug
ID: 555266
Opened: 4/29/2010 1:43:21 AM
Access Restriction: Public
User(s) can reproduce this bug


The C++ compiler generates wrong code using optimization flags /O2 and /Ox without /Os. The code is ok with /Od and /O1 or with /Os in combination with /O2 and /Ox.
Sign in to post a comment.
Posted by Microsoft on 9/20/2010 at 3:54 PM
Thanks for the feedback. We have investigated the issue and will fix it in a future release. As a temporary workaround, you may avoid initializing the induction variable l as a negative number. You may change the initialization of l from -1 to 0, and after the while loop, adjust l with l++. That should lead to correct results.
Posted by Microsoft on 8/30/2010 at 4:36 PM
As noted, we will address this bug in a future release. We will update this issue when we have more information.

Thank you.

Mark Levine
Dev Lead - Visual C++
Posted by Microsoft on 5/10/2010 at 4:06 PM
Thank you for reporting the issue. We are working on it. It will be fixed in a future release.
Posted by Microsoft on 4/29/2010 at 8:50 PM
Thank you for reporting this issue.
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.
Sign in to post a workaround.