Fix enregistered lclFld bug (dotnet/coreclr#18418)
authorCarol Eidt <carol.eidt@microsoft.com>
Wed, 13 Jun 2018 21:43:07 +0000 (14:43 -0700)
committerGitHub <noreply@github.com>
Wed, 13 Jun 2018 21:43:07 +0000 (14:43 -0700)
commit8c89c25ee007d0d36baa5053bf4de9645940b0f3
tree2c891446f9533c28ead501adf44cca5edafbd54a
parentecf6fdf97622510ec457aebabcb7349a65bb31fb
Fix enregistered lclFld bug (dotnet/coreclr#18418)

* Fix enregistered lclFld bug

In `impFixupStructReturnType()`, don't transform to `GT_LCL_FLD` if we have a scalar lclVar.
Also, to avoid future bad codegen, add verification and recovery code to Lowering.

Fix dotnet/coreclr#18408

* Extract the full conditions for whether a lclVar is a reg candidate, so it can be called from the assert in Lowering.

* Review feedback

Commit migrated from https://github.com/dotnet/coreclr/commit/82134a002fed96739694b6f085baaeea6c7c41f5
src/coreclr/src/jit/importer.cpp
src/coreclr/src/jit/lower.cpp
src/coreclr/src/jit/lower.h
src/coreclr/src/jit/lowerarmarch.cpp
src/coreclr/src/jit/lowerxarch.cpp
src/coreclr/src/jit/lsra.cpp
src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_18408/GitHub_18408.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_18408/GitHub_18408.csproj [new file with mode: 0644]