Fix for a jit liveness bug.
authorEugene Rozenfeld <erozen@microsoft.com>
Fri, 26 Apr 2019 22:22:53 +0000 (15:22 -0700)
committerEugene Rozenfeld <erozen@microsoft.com>
Fri, 26 Apr 2019 22:22:53 +0000 (15:22 -0700)
commit9d42c6540d3e54322e76c38e5ca840510b1a8638
treecc280bdc45082350c7ad142d3cf8b9cedac273d8
parent2f1e1e9ef6ecd903ef05556e67fb4be60a3ac11a
Fix for a jit liveness bug.

`fgRemoveDeadStore` has special logic for removing dead assignments
whose rhs was of type `TYP_STRUCT`:

https://github.com/dotnet/coreclr/blob/dotnet/coreclr@311b5e2fe413c6c74a2a3680ab54d8a978651472/src/jit/liveness.cpp#L2264-L2274

That logic was applied to "normal"
assignments (i.e., direct children of `GT_STMT`) but not to "internal"
assignments (e.g., children of `GT_COMMA`).
The test case has an internal assignment and, because this logic wasn't
applied, we ended up with a standalone `GT_IND` of type `TYP_STRUCT`
that the register allocator can't handle.

This change apples the missing logic to "internal" assignments.

Fixes dotnet/coreclr#24253.

Commit migrated from https://github.com/dotnet/coreclr/commit/e6ee8a2c075ac906f4d86d831cac124f2f22a504
src/coreclr/src/jit/liveness.cpp
src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_24253/GitHub_24253.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/Regression/JitBlue/GitHub_24253/GitHub_24253.csproj [new file with mode: 0644]