From 8e6fa5df402299d833f382679ecf31687f7237a2 Mon Sep 17 00:00:00 2001 From: Mike Danes Date: Sun, 25 Nov 2018 11:22:08 +0200 Subject: [PATCH] Don't generate copy assertions for normalize on load variables --- src/jit/assertionprop.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/jit/assertionprop.cpp b/src/jit/assertionprop.cpp index 88e6b009..dffc5b9 100644 --- a/src/jit/assertionprop.cpp +++ b/src/jit/assertionprop.cpp @@ -1182,6 +1182,13 @@ AssertionIndex Compiler::optCreateAssertion(GenTree* op1, goto DONE_ASSERTION; // Don't make an assertion } + // If we're making a copy of a "normalize on load" lclvar then the destination + // has to be "normalize on load" as well, otherwise we risk skipping normalization. + if (lclVar2->lvNormalizeOnLoad() && !lclVar->lvNormalizeOnLoad()) + { + goto DONE_ASSERTION; // Don't make an assertion + } + // If the local variable has its address exposed then bail if (lclVar2->lvAddrExposed) { -- 2.7.4