Fix IMGREL32 static field addr value-num blindspot
authorJoseph Tremoulet <jotrem@microsoft.com>
Tue, 23 Aug 2016 01:14:24 +0000 (21:14 -0400)
committerJoseph Tremoulet <jotrem@microsoft.com>
Wed, 31 Aug 2016 20:11:46 +0000 (16:11 -0400)
commite4cb4dd894472a9c5efef31e588a9caefd635d24
tree6a1f3d9890a28342f72292c29b080511fdac99bc
parentcda9b0fc9a5f206b391b1bd104e43bd6c29aad7f
Fix IMGREL32 static field addr value-num blindspot

When `fgMorphField` lowers a static field reference for which
`eeGetRelocTypeHint` returns `IMAGE_REL_BASED_REL32`, it creates an
`IntCon`, flagged with `GFT_ICON_STATIC_HDL` and marked with the static
field in its `gtFieldSeq` field, to represent the field's address (as
opposed to the normal case where it generates a `ClsVar`).  This change
updates the `IsFieldAddr` helper used by value-numbering/loop-hoisting to
recognize such constants as the appropriate field address, which then
allows the disambiguation/tracking of accesses to these fields to kick in
as it does for `ClsVar` nodes.

Also update test GC/Scenarios/FinalizeTimeout to mark a bool volatile that
otherwise can get hoisted (the test aims to observe finalization from a
side-effect-free busy-loop by communicating through this bool).

Fixes #6900.
src/jit/gentree.cpp
tests/src/GC/Scenarios/FinalizeTimeout/FinalizeTimeout.cs