Files
OrcaSlicer/deps/OCCT/0002-BRepGraph-MSVC-ARM64-ICE-workaround.patch
T
HanifKoh e0f7f0b7ee Work Around the MSVC 14.52 ARM64 Internal Compiler Error in OCCT (#17601)
The windows-11-vs2026-arm runner image 20261112.217.1 moved from MSVC 14.51 to 14.52, and its cl.exe crashes with C1001 while optimizing OCCT's BRepGraph_LayerTopoSupplement.cxx. clang-cl builds compile OCCT with cl on ARM64, so every Windows arm64 deps build on that image fails.

A second OCCT patch compiles that one file without optimization when the compiler is cl targeting ARM64. Other compilers and architectures see no change.
2026-11-16 15:35:35 +08:00

26 lines
1.0 KiB
Diff

diff --git a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerTopoSupplement.cxx b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerTopoSupplement.cxx
index 44e59b0..8833fed 100644
--- a/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerTopoSupplement.cxx
+++ b/src/ModelingData/TKBRep/BRepGraph/BRepGraph_LayerTopoSupplement.cxx
@@ -21,6 +21,12 @@
#include <Standard_ProgramError.hxx>
#include <TCollection_AsciiString.hxx>
+// MSVC 14.52 for ARM64 crashes with an internal compiler error (C1001) while
+// optimizing this file, so it is compiled without optimization there.
+#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_ARM64)
+ #pragma optimize("", off)
+#endif
+
IMPLEMENT_STANDARD_RTTIEXT(BRepGraph_LayerTopoSupplement, BRepGraph_Layer)
namespace
@@ -384,3 +390,7 @@ void BRepGraph_LayerTopoSupplement::removeOwner(const BRepGraph_NodeId theOwner)
myOwnerToUids.UnBind(theOwner);
touch();
}
+
+#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_ARM64)
+ #pragma optimize("", on)
+#endif