Skip to content

[release/6.0-staging] Workaround for C++ compiler bug on Arm64 #93530

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/coreclr/inc/safemath.h
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,9 @@ template<typename T> class ClrSafeInt
Which ought to inline nicely
*/
// Returns true if safe, false for overflow.
#if defined(_MSC_VER) && defined(HOST_ARM64) // Workaround for https://github.com/dotnet/runtime/issues/93442
#pragma optimize("", off)
#endif
static bool multiply(T lhs, T rhs, T &result)
{
if(Is64Bit())
Expand Down Expand Up @@ -675,6 +678,9 @@ template<typename T> class ClrSafeInt
}
}
}
#if defined(_MSC_VER) && defined(HOST_ARM64) // Workaround for https://github.com/dotnet/runtime/issues/93442
#pragma optimize("", on)
#endif

// Returns true if safe, false on overflow
static inline bool addition(T lhs, T rhs, T &result)
Expand Down