fgOptimizeBranch loses bbFlags while duplicating the block dotnet/coreclr#6886
authorEgor Chesakov <t-egche@microsoft.com>
Wed, 24 Aug 2016 00:35:10 +0000 (17:35 -0700)
committerEgor Chesakov <t-egche@microsoft.com>
Fri, 26 Aug 2016 16:51:35 +0000 (09:51 -0700)
commit6e71aa3b51872c37836f066ba3135d901d8c249c
tree6ba60d66d1a818593fcee156d891b41662ae0a64
parente7f3e5c8b4771db7749a22975ff36fdb02db31d0
fgOptimizeBranch loses bbFlags while duplicating the block dotnet/coreclr#6886

1. When `fgOptimizeBranch` procedure duplicates the conditional basic block it does
not copy flags of the `bDest` block to the `bJump` block. For example, if a flag
`BBF_HAS_NEWOBJ` was set in `bDest`, but not in `bJump` when the branch optimization
is done the `bbFlags` of `bJump` will not reflect the fact that we have new object
construction in this block.

2. In `DEBUG` always check if `bbFlags` has `BBF_HAS_NEWOBJ` flag set if at least one
`GT_ALLOCOBJ` canonical node found. This helps to identify situations when compiler loses `BBF_HAS_NEWOBJ` flag.

Commit migrated from https://github.com/dotnet/coreclr/commit/12f327477b6c1e18b6db7d0b2ec3445ef3997c17
src/coreclr/src/jit/flowgraph.cpp
src/coreclr/src/jit/objectalloc.cpp