Visual C++ Optimizer fixes for Visual Studio 2015 Update 3

Content provided by Microsoft

Applies to: Visual Studio 2015 Update 3

Select Product Version

This article describes a hotfix package for Microsoft Visual Studio 2015 Update 3. The hotfix contains several fixes to the Visual C++ optimizer and code generator (c2.dll). For more information, see the "Issues that are fixed in this hotfix" section.

Resolution

How to obtain this hotfix

The following file is available for download from the Microsoft Download Center:

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.

Prerequisites

To apply this hotfix, you must have Visual Studio 2015 Update 3 installed.

Restart requirement

You may have to restart the computer after you apply this hotfix if no instance of Visual Studio is being used.

Hotfix replacement information

This hotfix doesn't replace other hotfixes.

Issues that are fixed in this hotfix

This hotfix contains fixes for the following issues:

Fixes a bug in the optimizer when hoisting a loop-variant conditional store outside a loop:

int test_div(bool flag, int dummy){ int result = std::numeric_limits<int>::min(); int other; if (flag) other = -1; else other = dummy - 1 - dummy; result /= other; // We would push the division up into both arms of the // if-then-else. One of those divisions would cause the // optimizer to evaluate MIN_INT/-1.This is a crash, similar // to dividing by zero. A workaround is /d2SSAOptimizer- return result;}

Offers a workaround for C4883 ": function size suppresses optimizations". When the optimizer sees functions that are massive, it will scale back the optimizations that it performs. It will issue a C4883 warning when it does this, if you have enabled the warning via /we4883. If you want to override this decision to suppress optimizations, throw the /d2OptimizeHugeFunctions switch.

Fixes for a compiler crash in c2!PpCanPropagateForward when you perform optimizations on x64.