[llvm-branch-commits] [cfe-branch] r308988 - Merging r308897:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jul 25 10:10:17 PDT 2017


Author: hans
Date: Tue Jul 25 10:10:17 2017
New Revision: 308988

URL: http://llvm.org/viewvc/llvm-project?rev=308988&view=rev
Log:
Merging r308897:
------------------------------------------------------------------------
r308897 | nico | 2017-07-24 09:54:11 -0700 (Mon, 24 Jul 2017) | 9 lines

Work around an MSVC2017 update 3 codegen bug.

C2017 update 3 produces a clang that crashes when compiling clang. Disabling
optimizations for StmtProfiler::VisitCXXOperatorCallExpr() makes the crash go
away.

Patch from Bruce Dawson <brucedawson at chromium.org>!
https://reviews.llvm.org/D35757

------------------------------------------------------------------------

Modified:
    cfe/branches/release_50/   (props changed)
    cfe/branches/release_50/lib/AST/StmtProfile.cpp

Propchange: cfe/branches/release_50/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul 25 10:10:17 2017
@@ -1,4 +1,4 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:308455
+/cfe/trunk:308455,308897
 /cfe/trunk/test:170344
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_50/lib/AST/StmtProfile.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_50/lib/AST/StmtProfile.cpp?rev=308988&r1=308987&r2=308988&view=diff
==============================================================================
--- cfe/branches/release_50/lib/AST/StmtProfile.cpp (original)
+++ cfe/branches/release_50/lib/AST/StmtProfile.cpp Tue Jul 25 10:10:17 2017
@@ -1388,6 +1388,15 @@ static Stmt::StmtClass DecodeOperatorCal
   llvm_unreachable("Invalid overloaded operator expression");
 }
 
+#if defined(_MSC_VER)
+#if _MSC_VER == 1911
+// Work around https://developercommunity.visualstudio.com/content/problem/84002/clang-cl-when-built-with-vc-2017-crashes-cause-vc.html
+// MSVC 2017 update 3 miscompiles this function, and a clang built with it
+// will crash in stage 2 of a bootstrap build.
+#pragma optimize("", off)
+#endif
+#endif
+
 void StmtProfiler::VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *S) {
   if (S->isTypeDependent()) {
     // Type-dependent operator calls are profiled like their underlying
@@ -1420,6 +1429,12 @@ void StmtProfiler::VisitCXXOperatorCallE
   ID.AddInteger(S->getOperator());
 }
 
+#if defined(_MSC_VER)
+#if _MSC_VER == 1911
+#pragma optimize("", on)
+#endif
+#endif
+
 void StmtProfiler::VisitCXXMemberCallExpr(const CXXMemberCallExpr *S) {
   VisitCallExpr(S);
 }




More information about the llvm-branch-commits mailing list