Fix a bug with disappeared cast to byte in numeric binary expressions
authorAndrey Akinshin <andrey.akinshin@gmail.com>
Mon, 3 Aug 2015 13:33:26 +0000 (16:33 +0300)
committerAndrey Akinshin <andrey.akinshin@gmail.com>
Wed, 12 Aug 2015 04:26:01 +0000 (07:26 +0300)
commit3bfbb9bca6698c9068e42a577613343f12f24898
treec94b1aa10fb4e53b8a28a1f10dcbffe0d75ea192
parentcd84f26ee25e72e29be64addda1ad1c85561af73
Fix a bug with disappeared cast to byte in numeric binary expressions

Lowering::IndirsAreEquivalent doesn't check if the 2 indirections have the same type and because of that a RMW style instruction is generated instead of the expected

movzx    rax, byte  ptr [7FFA61024742h]
xor      eax, 33
mov      word  ptr [7FFA61024742h], ax

This behavior was fixed by adding an additional check to IndirsAreEquivalent (implementation of the mikedn's approach: https://github.com/dotnet/coreclr/pull/1329#discussion_r36397171).

Fix #1323.
src/jit/lower.cpp
tests/src/JIT/Regression/JitBlue/GitHub_1323/GitHub_1323.cs [new file with mode: 0644]
tests/src/JIT/Regression/JitBlue/GitHub_1323/GitHub_1323.csproj [new file with mode: 0644]
tests/src/JIT/Regression/JitBlue/GitHub_1323/app.config [new file with mode: 0644]