Skip to content

Instantly share code, notes, and snippets.

View CookiePLMonster's full-sized avatar

Silent CookiePLMonster

View GitHub Profile
@CookiePLMonster
CookiePLMonster / repro.cpp
Last active September 16, 2020 13:23 — forked from riverar/repro.cpp
VS optimizer bug sample
#include <iostream>
#include <cmath>
// Sample of an optimizer bug in Visual Studio 2003 - 2019 (or more)
//
// Compiling this program in Release (/O1, /O2 or /Ox and LTCG) in both x86 and x64
// configurations produces a different output from unoptimized (Debug) configurations.
//
// Expected output: 709
// Produced output: 31