Address PR feedback.
authorPat Gavlin <pgavlin@gmail.com>
Thu, 17 Nov 2016 16:47:27 +0000 (08:47 -0800)
committerPat Gavlin <pgavlin@gmail.com>
Thu, 17 Nov 2016 16:47:27 +0000 (08:47 -0800)
Commit migrated from https://github.com/dotnet/coreclr/commit/c30cd2b84608cc855cf0603c268fb126665b42a4

src/coreclr/src/jit/emitxarch.cpp

index f9fd898..7c384aa 100644 (file)
@@ -2903,10 +2903,18 @@ regNumber emitter::emitInsBinary(instruction ins, emitAttr attr, GenTree* dst, G
         varNum = tmpDsc->tdTempNum();
         offset = 0;
     }
-    else if (memBase->OperGet() == GT_LCL_VAR_ADDR)
+    else
     {
-        varNum = memBase->AsLclVarCommon()->GetLclNum();
-        offset = 0;
+        // At this point we must have a memory operand that is a contained indir: if we do not, we should have handled
+        // this instruction above in the reg/imm or reg/reg case.
+        assert(mem != nullptr);
+        assert(memBase != nullptr);
+
+        if (memBase->OperGet() == GT_LCL_VAR_ADDR)
+        {
+            varNum = memBase->AsLclVarCommon()->GetLclNum();
+            offset = 0;
+        }
     }
 
     // Spill temp numbers are negative and start with -1
@@ -2915,8 +2923,7 @@ regNumber emitter::emitInsBinary(instruction ins, emitAttr attr, GenTree* dst, G
     if (varNum != BAD_VAR_NUM || tmpDsc != nullptr)
     {
         // Is the memory op in the source position?
-        if (src->isContainedLclField() || src->isContainedLclVar() || src->isContainedSpillTemp() ||
-            src->isContainedMemoryOp())
+        if (src->isContainedMemoryOp())
         {
             if (instrHasImplicitRegPairDest(ins))
             {