Don't morph volatile IND(ADDR(LCL_VAR)) (#20843)
authormikedn <onemihaid@hotmail.com>
Fri, 21 Dec 2018 00:10:27 +0000 (02:10 +0200)
committerSergey Andreenko <seandree@microsoft.com>
Fri, 21 Dec 2018 00:10:27 +0000 (16:10 -0800)
commit3e216841102ab82a6f4b276aadd8558d78819c12
tree5c9d51facb5b6bbb81e1abc50d2b5c732d2ead21
parentb0996f3c12faf1d1b5d965087cfa62fc8c84a75b
Don't morph volatile IND(ADDR(LCL_VAR)) (#20843)

Besides the fact that volatile indirections aren't supposed to be removed doing so in this case results in incorrect code being generated.

The GT_IND node has GTF_DONT_CSE set and this gets copied to the GT_LCL_VAR node. Later this prevents the insertion of a normalization cast because GTF_DONT_CSE on a GT_LCL_VAR node is assumed to mean that the variable address is being taken.
src/jit/morph.cpp
tests/src/JIT/Regression/JitBlue/GitHub_19599/GitHub_19599.cs [new file with mode: 0644]
tests/src/JIT/Regression/JitBlue/GitHub_19599/GitHub_19599.csproj [new file with mode: 0644]