Fix issue #32466 (#32804)
authorBrian Sullivan <briansul@microsoft.com>
Wed, 26 Feb 2020 03:02:29 +0000 (19:02 -0800)
committerGitHub <noreply@github.com>
Wed, 26 Feb 2020 03:02:29 +0000 (19:02 -0800)
* Fix issue #32466

Fixes outerloop leg: R2R Windows_NT x86 Checked no_tiered_compilation @ Windows.10.Amd64.Open

* Updated the comment associated with this assert

src/coreclr/src/jit/emitxarch.cpp

index 22b800e..38a3fff 100644 (file)
@@ -2833,9 +2833,16 @@ void emitter::emitHandleMemOp(GenTreeIndir* indir, instrDesc* id, insFormat fmt,
         // Absolute addresses marked as contained should fit within the base of addr mode.
         assert(memBase->AsIntConCommon()->FitsInAddrBase(emitComp));
 
-        // Either not generating relocatable code, or addr must be an icon handle, or the
-        // constant is zero (which we won't generate a relocation for).
-        assert(!emitComp->opts.compReloc || memBase->IsIconHandle() || memBase->IsIntegralConst(0));
+        // If we reach here, either:
+        // - we are not generating relocatable code, (typically the non-AOT JIT case)
+        // - the base address is a handle represented by an integer constant,
+        // - the base address is a constant zero, or
+        // - the base address is a constant that fits into the memory instruction (this can happen on x86).
+        //   This last case is captured in the FitsInAddrBase method which is used by Lowering to determine that it can
+        //   be contained.
+        //
+        assert(!emitComp->opts.compReloc || memBase->IsIconHandle() || memBase->IsIntegralConst(0) ||
+               memBase->AsIntConCommon()->FitsInAddrBase(emitComp));
 
         if (memBase->AsIntConCommon()->AddrNeedsReloc(emitComp))
         {