diff --git a/src/coreclr/jit/lowerxarch.cpp b/src/coreclr/jit/lowerxarch.cpp index 51b11fc089cf19..498e0fe936aa4d 100644 --- a/src/coreclr/jit/lowerxarch.cpp +++ b/src/coreclr/jit/lowerxarch.cpp @@ -7696,7 +7696,7 @@ void Lowering::ContainCheckCallOperands(GenTreeCall* call) } else #endif // TARGET_X86 - if (ctrlExpr->isIndir()) + if (ctrlExpr->isIndir() && IsSafeToContainMem(call, ctrlExpr)) { // We may have cases where we have set a register target on the ctrlExpr, but if it // contained we must clear it.