Fix dotnet/coreclr#3554. (dotnet/coreclr#6880)
authorPat Gavlin <pgavlin@gmail.com>
Wed, 24 Aug 2016 22:50:04 +0000 (15:50 -0700)
committerGitHub <noreply@github.com>
Wed, 24 Aug 2016 22:50:04 +0000 (15:50 -0700)
commitff2e49d01932bf0a8d8026843142790164d2aeb0
treecfbd5e69059818346709877ab8b9d95a4602c586
parent38b8ba398a4013260c833638d5b45159a72c1410
Fix dotnet/coreclr#3554. (dotnet/coreclr#6880)

On x86, `emitter::emitInsBinary` was calling `genProduceReg` on the
`dst` tree if the source was a contained class field load and the
destination was a register. As per the comment on the offending
function, it is the caller's responsibility to call `genProduceReg`
for the destination register, if any. This was causing errors in
GC ref reporting on x86. This issue did not appear on x64 because
AFAICT we very nearly always morph class field loads into loads of
a `CNS_INT` handle (see morph.cpp:6344 in `fgMorphField` for
details).

Commit migrated from https://github.com/dotnet/coreclr/commit/2c38643f91d98a278d8084c2d776d927a4405e16
src/coreclr/src/jit/emitxarch.cpp
src/coreclr/tests/issues.targets