diff options
author | Bruce Forstall <brucefo@microsoft.com> | 2016-10-30 02:34:49 -0700 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2016-10-30 02:34:49 -0700 |
commit | 3fc65f37cd4bf5989647f6e1a48da6821ea5adbd (patch) | |
tree | 4f6fa777d4fa18608c8a9b3638f025b7d73d463c /src | |
parent | d64c7d60fcc8132c8a57c5c3c9d6e296232520dd (diff) | |
download | coreclr-3fc65f37cd4bf5989647f6e1a48da6821ea5adbd.tar.gz coreclr-3fc65f37cd4bf5989647f6e1a48da6821ea5adbd.tar.bz2 coreclr-3fc65f37cd4bf5989647f6e1a48da6821ea5adbd.zip |
Work around a Visual C++ silent bad code generation bug (#7890)
Fixes #7837
The full description of the problem is in that issue.
Diffstat (limited to 'src')
-rw-r--r-- | src/vm/dllimportcallback.cpp | 8 | ||||
-rw-r--r-- | src/vm/jitinterface.cpp | 12 |
2 files changed, 14 insertions, 6 deletions
diff --git a/src/vm/dllimportcallback.cpp b/src/vm/dllimportcallback.cpp index 8db5a4fd48..cfac3cdb47 100644 --- a/src/vm/dllimportcallback.cpp +++ b/src/vm/dllimportcallback.cpp @@ -1320,7 +1320,9 @@ MethodDesc* UMThunkMarshInfo::GetILStubMethodDesc(MethodDesc* pInvokeMD, PInvoke dwStubFlags |= NDIRECTSTUB_FL_REVERSE_INTEROP; // could be either delegate interop or not--that info is passed in from the caller #if defined(DEBUGGING_SUPPORTED) - if (GetDebuggerCompileFlags(pSigInfo->GetModule(), CORJIT_FLAGS()).IsSet(CORJIT_FLAGS::CORJIT_FLAG_DEBUG_CODE)) + // Combining the next two lines, and eliminating jitDebuggerFlags, leads to bad codegen in x86 Release builds using Visual C++ 19.00.24215.1. + CORJIT_FLAGS jitDebuggerFlags = GetDebuggerCompileFlags(pSigInfo->GetModule(), CORJIT_FLAGS()); + if (jitDebuggerFlags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_DEBUG_CODE)) { dwStubFlags |= NDIRECTSTUB_FL_GENERATEDEBUGGABLEIL; } @@ -1394,7 +1396,9 @@ VOID UMThunkMarshInfo::RunTimeInit() DWORD dwStubFlags = NDIRECTSTUB_FL_NGENEDSTUB | NDIRECTSTUB_FL_REVERSE_INTEROP | NDIRECTSTUB_FL_DELEGATE; #if defined(DEBUGGING_SUPPORTED) - if (GetDebuggerCompileFlags(GetModule(), CORJIT_FLAGS()).IsSet(CORJIT_FLAGS::CORJIT_FLAG_DEBUG_CODE)) + // Combining the next two lines, and eliminating jitDebuggerFlags, leads to bad codegen in x86 Release builds using Visual C++ 19.00.24215.1. + CORJIT_FLAGS jitDebuggerFlags = GetDebuggerCompileFlags(GetModule(), CORJIT_FLAGS()); + if (jitDebuggerFlags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_DEBUG_CODE)) { dwStubFlags |= NDIRECTSTUB_FL_GENERATEDEBUGGABLEIL; } diff --git a/src/vm/jitinterface.cpp b/src/vm/jitinterface.cpp index 0ac9bd9373..8171eb6cc2 100644 --- a/src/vm/jitinterface.cpp +++ b/src/vm/jitinterface.cpp @@ -7394,11 +7394,15 @@ CorInfoInline CEEInfo::canInline (CORINFO_METHOD_HANDLE hCaller, // If the callee wants debuggable code, don't allow it to be inlined - if (GetDebuggerCompileFlags(pCallee->GetModule(), CORJIT_FLAGS()).IsSet(CORJIT_FLAGS::CORJIT_FLAG_DEBUG_CODE)) { - result = INLINE_NEVER; - szFailReason = "Inlinee is debuggable"; - goto exit; + // Combining the next two lines, and eliminating jitDebuggerFlags, leads to bad codegen in x86 Release builds using Visual C++ 19.00.24215.1. + CORJIT_FLAGS jitDebuggerFlags = GetDebuggerCompileFlags(pCallee->GetModule(), CORJIT_FLAGS()); + if (jitDebuggerFlags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_DEBUG_CODE)) + { + result = INLINE_NEVER; + szFailReason = "Inlinee is debuggable"; + goto exit; + } } #endif |