この資料では、Microsoft Visual Studio 2015 の更新プログラム 3 の修正プログラム パッケージを説明します。修正プログラムには、オプティマイザーの Visual C++ コード ジェネレーター (c2.dll) をいくつかの修正が含まれています。詳細については、「この修正プログラムで修正される問題」を参照してください。
解決策
この修正プログラムを入手する方法
次のファイルが Microsoft ダウンロード センターからダウンロードできます。
修正プログラム パッケージを今すぐダウンロードします。
Microsoft サポート ファイルをダウンロードする方法の詳細については、次の記事番号をクリックして、マイクロソフト サポート技術情報の記事をご参照ください。
119591オンライン サービスからマイクロソフトのサポート ファイルを入手する方法このファイルは、マイクロソフトによってウイルス スキャン済みです。マイクロソフトは、ファイルが公表された日付に使用可能な最新のウイルス検出ソフトウェアを使用しています。このファイルは、ファイルへの不正な変更を防止するセキュリティが強化されたサーバーに格納されています。
必要条件
この修正プログラムを適用するには、インストールされている Visual Studio の 2015 更新 3 が必要です。
再起動の必要性
Visual Studio のインスタンスが使用されていない場合にこの修正プログラムを適用した後コンピューターを再起動する必要があります。
修正プログラムの置き換えに関する情報
この修正プログラムでは、他の修正プログラムを置き換えません。
この修正プログラムで修正される問題
この修正プログラムには、次の問題に対する修正が含まれています。
-
ループの外側のループ バリアント条件付きストアをホイストするときは、オプティマイザーのバグを修正します。 #include <cstdlib> #include <cassert> struct Foo { int a; int b; }; int main() { Foo foo; foo.b = rand(); int a = rand(); int b = foo.b; for (int i = 0; i < 10; ++i) { int inner_b = b; int inner_a = a; if (inner_b < 0) // This gets incorrect hoisted outside the loop. // A workaround is /d2SSAOptimizer- { inner_a = 0; inner_b = 0; } if (inner_b >= 0) assert(inner_a == a); a += b; } return 0; }
-
オプティマイザーでは、整数除算のバグを修正します。 #include <stdio.h> volatile int z = 0; int main() { unsigned a, b; __int64 c; a = z; c = a; c = (c == 0) ? 1LL : c; b = (unsigned)((__int64)a * 100 / c); // Division was made unconditional // incorrectly creating a divide by zero. // A workaround is /d2SSAOptimizer- printf("%u\n", b); return 0; }
-
オプティマイザーでは、整数除算のバグを修正します。 int checkchecksum(int suly, int ell, int utkodert) { int x; ell -= utkodert; ell %= 103; if (suly - 1) utkodert /= (suly - 1); // Division was made unconditional, // incorrectly creating a potential divide by zero // A workaround is /d2SSAOptimizer- return utkodert; }
-
オプティマイザーでは、整数除算のバグを修正します。 typedef int unsigned uint; volatile uint out_index = 0; bool data[1] = {true}; bool __declspec(noinline) BugSSA(uint index) { uint group = index / 3; if (group == 0) // The division result being compared to zero is replaced // with a range check. We then incorrectly move the division { // to the next use of "group", without accounting for the fact // that "index" has changed. A workaround is /d2SSAOptimizer- return false; } index -= 3; group--; bool ret = data[group]; // crash here out_index = index; out_index = index; return ret; } int main() { volatile uint i = 3; return BugSSA(i); }
-
-1 で MIN_INT の部門に、オプティマイザーでのクラッシュの修正します。 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; }
-
オプティマイザーでスタック オーバーフローが修正されます。 #include <stdio.h> // This example produced a stack overflow in the optimizer, which was // caused by mutually-recursive analysis functions not properly tracking // the number of times they were invocated. // A workaround is /d2SSAOptimizer- typedef unsigned char byte; typedef unsigned long long int uint64; int main() { const uint64 *sieveData = new uint64[1024]; uint64 bitIndexShift = 0; uint64 curSieveChunk = 0xfafd7bbef7ffffffULL & ~uint64(3); const unsigned int *NumbersCoprimeToModulo = new unsigned int[16]; const unsigned int *PossiblePrimesForModuloPtr = NumbersCoprimeToModulo; while (!curSieveChunk) { curSieveChunk = *(sieveData++); const uint64 NewValues = (16 << 8) | (32 << 24); bitIndexShift = (NewValues >> (bitIndexShift + 8)) & 255; PossiblePrimesForModuloPtr = NumbersCoprimeToModulo + bitIndexShift; } if (PossiblePrimesForModuloPtr - NumbersCoprimeToModulo != 0) { printf("fail"); return 1; } printf("pass"); return 0; }
-
削除冗長なフローティング ポイント使用する変換が f64 に、int32 型のパラメーターを変換すると不正なコード生成のための修正します。 #include <string> __declspec(noinline) void test(int Val) { double Val2 = Val; std::string Str; printf("%lld\n", __int64(Val2)); // We incorrectly try to read 64 bits of // floating point from the parameter area, // instead of reading 32 bits of integer // and converting it. A workaround is // to throw /d2SSAOptimizer- } int main() { test(6); test(7); return 0; }
-
Https://bugs.chromium.org/p/chromium/issues/detail?id=627216#c15を参照してください、既定のステートメントの詳細については、switch ブロックのフロー グラフ ノードを分割するときは、オプティマイザーのクラッシュを修正します。
-
主吸気変数の倍数である符号なしの二次誘導変数の不適切な力の削減を実行してループの最適化でバグを修正します。 #include <assert.h> #include <malloc.h> #include <stdio.h> typedef unsigned int uint; typedef unsigned char byte; /* There is a corner case in the compiler's loop optimizer. The corner case arose if an induction variable (IV) is a multiple of the loop index, and there's a comparison of the IV to an integer that is less than this multiplication factor. A workaround is to use #pragma optimize("", off) / #pragma optimize("", on) around the affected function. */ int main(int argc, char *argv[]) { const uint w = 256; const uint h = 64; const uint w_new = w >> 1; const uint h_new = h >> 1; const byte *const src = (byte *)malloc(w * h); byte *it_out = (byte *)malloc(w_new * h_new); int fail = 0; for (uint y_new = 0; y_new < h_new; ++y_new) { for (uint x_new = 0; x_new < w_new; ++x_new, ++it_out) { uint x = x_new * 2; uint y = y_new * 2; if (x < 1 || y < 1) { *it_out = 0; continue; } if (x != 0) { } else { fail = 1; } *it_out = 4 * src[y * w + x]; } } if (fail) { printf("fail\n"); return (1); } printf("pass\n"); return (0); }
-
C4883 の回避策を提供しています]: 関数のサイズの最適化を抑制する"です。オプティマイザーでは、大規模な機能を見て、それを実行する最適化拡大縮小戻す。それは警告 C4883 れたとき、/we4883 を使用して警告を有効にした場合。最適化を抑制するには、この決定をオーバーライドする場合は、/d2OptimizeHugeFunctions スイッチをスローします。
-
C2 でコンパイラのクラッシュを修正します。X64 での最適化を実行するときに PpCanPropagateForward。
-
誤った誘導変数強度の減少を含むループのオプティマイザーのバグが修正されます。
-
不適切な並べ替え式の読み取りに関連する修正プログラムし、不適切な別名の確認のためのメモリに書き込みます。
-
コンパイラによって生成された一時的な既存の複数の例外処理の領域全体を含むレジスタ アロケーターのバグを修正します。
状況
マイクロソフトは、この問題を「対象製品」セクションに記載されているマイクロソフト製品の問題として認識しています。