Fix DevDiv issue with JitStressRegs=0x3 on arm32. (dotnet/coreclr#20485)
authorSergey Andreenko <seandree@microsoft.com>
Wed, 31 Oct 2018 19:13:25 +0000 (12:13 -0700)
committerGitHub <noreply@github.com>
Wed, 31 Oct 2018 19:13:25 +0000 (12:13 -0700)
* Fix the issue.

* Fix the comment.

* update the comment

Commit migrated from https://github.com/dotnet/coreclr/commit/85c61f151c04c1d3cec782532b17969795f07a93

src/coreclr/src/jit/lsrabuild.cpp

index 3326372..02464a1 100644 (file)
@@ -1581,6 +1581,14 @@ void LinearScan::buildRefPositionsForNode(GenTree* tree, BasicBlock* block, Lsra
                 }
             }
         }
+
+        if (tree->OperIsPutArgSplit())
+        {
+            // While we have attempted to account for any "specialPutArg" defs above, we're only looking at RefPositions
+            // created for this node. We must be defining at least one register in the PutArgSplit, so conservatively
+            // add one less than the maximum number of registers args to 'minRegCount'.
+            minRegCount += MAX_REG_ARG - 1;
+        }
         for (refPositionMark++; refPositionMark != refPositions.end(); refPositionMark++)
         {
             RefPosition* newRefPosition    = &(*refPositionMark);