From: David Wrighton Date: Thu, 5 Nov 2020 22:55:36 +0000 (-0800) Subject: Set fgOptimizedFinally flag correctly (#44268) X-Git-Tag: submit/tizen/20210909.063632~4747 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b3aac608a6d64136b2dc0812e5720764f227f10f;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Set fgOptimizedFinally flag correctly (#44268) - Initialize to 0 at compiler startup - Set flag when finally cloning optimization kicks in Fixes non-deterministic generation of nop opcodes into ARM32 code --- diff --git a/src/coreclr/src/jit/flowgraph.cpp b/src/coreclr/src/jit/flowgraph.cpp index f2ca85c..8ee9e69 100644 --- a/src/coreclr/src/jit/flowgraph.cpp +++ b/src/coreclr/src/jit/flowgraph.cpp @@ -122,6 +122,9 @@ void Compiler::fgInit() /* This global flag is set whenever we add a throw block for a RngChk */ fgRngChkThrowAdded = false; /* reset flag for fgIsCodeAdded() */ + /* Keep track of whether or not EH statements have been optimized */ + fgOptimizedFinally = false; + /* We will record a list of all BBJ_RETURN blocks here */ fgReturnBlocks = nullptr; @@ -25436,6 +25439,7 @@ PhaseStatus Compiler::fgCloneFinally() if (cloneCount > 0) { JITDUMP("fgCloneFinally() cloned %u finally handlers\n", cloneCount); + fgOptimizedFinally = true; #ifdef DEBUG if (verbose)