Fix the srcCount for an unused GT_LONG.
authorPat Gavlin <pagavlin@microsoft.com>
Tue, 30 Aug 2016 23:53:40 +0000 (16:53 -0700)
committerPat Gavlin <pagavlin@microsoft.com>
Tue, 30 Aug 2016 23:53:40 +0000 (16:53 -0700)
GT_LONG nodes that do not have a corresponding use need to
consume their operands. There was already code in lowerxarch
that attempted to do so, but this code was no longer valid in
LIR.

src/jit/lowerxarch.cpp

index 389f9a53fe76a6ac688d2cacf8ef4f55b10bda73..a1e3aa32bda31994ead1ff25c97ff2b4dcf68430 100644 (file)
@@ -239,9 +239,9 @@ void Lowering::TreeNodeInfoInit(GenTree* tree)
 #if !defined(_TARGET_64BIT_)
 
         case GT_LONG:
-            if (tree->gtNext == nullptr)
+            if ((tree->gtLIRFlags & LIR::Flags::IsUnusedValue) != 0)
             {
-                // An uncontained GT_LONG node needs to consume its source operands
+                // An unused GT_LONG node needs to consume its sources.
                 info->srcCount = 2;
             }
             else
@@ -249,6 +249,7 @@ void Lowering::TreeNodeInfoInit(GenTree* tree)
                 // Passthrough
                 info->srcCount = 0;
             }
+
             info->dstCount = 0;
             break;