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.

Commit migrated from https://github.com/dotnet/coreclr/commit/6dd8f10aa73f098dedb4ccf58d145a9a55665495

src/coreclr/src/jit/lowerxarch.cpp

index 389f9a5..a1e3aa3 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;