Skip to content

Instantly share code, notes, and snippets.

@bcrist
Created June 10, 2014 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bcrist/53035b973fb0e6f8ed52 to your computer and use it in GitHub Desktop.
Save bcrist/53035b973fb0e6f8ed52 to your computer and use it in GitHub Desktop.
MSVC optimizer bug
#include <iostream>
using namespace std;
int main()
{
int A[12] = {
1, 1, 1, 1,
1, 1, 1, 1,
1, 1, 1, 1
};
int sum = 0;
for (int i = 0; i <= 11; ++i)
{
sum += A[11 - i];
}
cout << sum << endl;
cin.get();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment