Use LclFld for full-width cpblk of different types
authorCarol Eidt <carol.eidt@microsoft.com>
Wed, 21 Nov 2018 22:12:03 +0000 (14:12 -0800)
committerCarol Eidt <carol.eidt@microsoft.com>
Tue, 27 Nov 2018 01:01:25 +0000 (17:01 -0800)
commit2ca7494048fbe2994f719e9000a9be8eae9a8fca
treeca56b20011f7da66db247f53e01ba39b1102daa3
parent301ae1001e174ffcc052b75b1b44ba0e6de88008
Use LclFld for full-width cpblk of different types

This issue arose because the source tree was a struct with a single double field, and the destination was a struct with a single long field. Copy prop replaced the lclVar in the source, which was under a `IND(ADDR)` with a lclVar that was not address taken, although it was marked `GTF_DONT_CSE`. Replacing the src tree with a `GT_LCL_FLD` addresses this issue.

Also, ensure that the target is marked `DoNotEnregister` if it isn't referenced as the same size/type.

Fix dotnet/coreclr#21080
Fix dotnet/coreclr#21064

Commit migrated from https://github.com/dotnet/coreclr/commit/0c08dc461f4dd7ac418a475264129d2c57536955
src/coreclr/src/jit/morph.cpp
src/coreclr/tests/issues.targets