aboutsummaryrefslogtreecommitdiff
path: root/ports/llvm/0006-workaround-msvc-bug.patch
diff options
context:
space:
mode:
authoryurybura <yurybura@gmail.com>2020-11-30 20:56:22 +0300
committerGitHub <noreply@github.com>2020-11-30 09:56:22 -0800
commite95a7a8dc04da4bddb24a6fc122fe9dc3ccc7151 (patch)
tree63f0547f6570ba95b014eaa6000d2d6b98d1c8d8 /ports/llvm/0006-workaround-msvc-bug.patch
parent7c080309821ddd58e72e2f669fb61c0863d5736b (diff)
downloadvcpkg-e95a7a8dc04da4bddb24a6fc122fe9dc3ccc7151.tar.gz
vcpkg-e95a7a8dc04da4bddb24a6fc122fe9dc3ccc7151.zip
[llvm] update to 11.0.0 (#13998)
* [vcpkg] allow to use semicolons in COMMAND argument * [llvm] update to 11.0.0 * [vcpkg] use latest version * [vcpkg] allow to use semicolons in OPTIONS * fix vcpkg_fixup_cmake_targets * [llvm] fix more install paths, add /bigobj option, fix up CMake targets * Apply suggestions from code review * [llvm] fix clang, flang, lld, mlir and polly CMake targets * [llvm] remove empty include directory /include/flang/Config * [llvm] Flang requires C++17 * [llvm] add /Zc:__cplusplus * [llvm] remove empty include directory include/clang-tidy/plugin * [llvm] try to fix ClangConfig.cmake, LLVMConfig.cmake, LLDConfig.cmake etc. with patch * [llvm] set tools install dir to tools/llvm * [aws-sdk-cpp] fix build after changes in vcpkg_configure_cmake.cmake * [llvm] disable Flang and OpenMP on Windows Co-authored-by: Nicole Mazzuca <mazzucan@outlook.com>
Diffstat (limited to 'ports/llvm/0006-workaround-msvc-bug.patch')
-rw-r--r--ports/llvm/0006-workaround-msvc-bug.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/ports/llvm/0006-workaround-msvc-bug.patch b/ports/llvm/0006-workaround-msvc-bug.patch
new file mode 100644
index 000000000..db1574b9c
--- /dev/null
+++ b/ports/llvm/0006-workaround-msvc-bug.patch
@@ -0,0 +1,39 @@
+diff --git a/llvm/lib/CodeGen/GlobalISel/LegalityPredicates.cpp b/llvm/lib/CodeGen/GlobalISel/LegalityPredicates.cpp
+--- a/llvm/lib/CodeGen/GlobalISel/LegalityPredicates.cpp
++++ b/llvm/lib/CodeGen/GlobalISel/LegalityPredicates.cpp
+@@ -10,6 +10,17 @@
+ //
+ //===----------------------------------------------------------------------===//
+
++// Disable optimizations to work around MSVC debug mode bug in 32-bit:
++// https://developercommunity.visualstudio.com/content/problem/1179643/msvc-copies-overaligned-non-trivially-copyable-par.html
++// FIXME: Remove this when the issue is closed.
++#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_IX86)
++// We have to disable runtime checks in order to enable optimizations. This is
++// done for the entire file because the problem is actually observed in STL
++// template functions.
++#pragma runtime_checks("", off)
++#pragma optimize("gs", on)
++#endif
++
+ #include "llvm/CodeGen/GlobalISel/LegalizerInfo.h"
+
+ using namespace llvm;
+diff --git a/llvm/unittests/CodeGen/GlobalISel/LegalizerInfoTest.cpp b/llvm/unittests/CodeGen/GlobalISel/LegalizerInfoTest.cpp
+--- a/llvm/unittests/CodeGen/GlobalISel/LegalizerInfoTest.cpp
++++ b/llvm/unittests/CodeGen/GlobalISel/LegalizerInfoTest.cpp
+@@ -406,3 +406,13 @@
+ 32, 8, AtomicOrdering::NotAtomic }));
+ }
+ }
++
++// This code sequence doesn't do anything, but it covers a previously uncovered
++// codepath that used to crash in MSVC x86_32 debug mode.
++TEST(LegalizerInfoTest, MSVCDebugMiscompile) {
++ const LLT S1 = LLT::scalar(1);
++ const LLT P0 = LLT::pointer(0, 32);
++ LegalizerInfo LI;
++ auto Builder = LI.getActionDefinitionsBuilder(TargetOpcode::G_PTRTOINT);
++ (void)Builder.legalForCartesianProduct({S1}, {P0});
++}
+