JIT: Properly handle a switch opt case during early flow opts (#40434)
authorAndy Ayers <andya@microsoft.com>
Thu, 6 Aug 2020 19:01:01 +0000 (12:01 -0700)
committerGitHub <noreply@github.com>
Thu, 6 Aug 2020 19:01:01 +0000 (12:01 -0700)
Don't try rethreading statement lists if we're doing and early flow opt.

Fixes #40195.

src/coreclr/src/jit/flowgraph.cpp

index 89ce176..242a4c5 100644 (file)
@@ -14704,9 +14704,9 @@ bool Compiler::fgOptimizeSwitchBranches(BasicBlock* block)
             LIR::ReadOnlyRange range(zeroConstNode, switchTree);
             m_pLowering->LowerRange(block, range);
         }
-        else
+        else if (fgStmtListThreaded)
         {
-            // Re-link the nodes for this statement.
+            gtSetStmtInfo(switchStmt);
             fgSetStmtSeq(switchStmt);
         }