fgOptimizeBranch loses bbFlags while duplicating the block #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)
commit12f327477b6c1e18b6db7d0b2ec3445ef3997c17
tree0ded28496e075b3a41b022e63390313634fd9fb4
parent7234a53b0e50c330c8e438c36acced507a83e5e0
fgOptimizeBranch loses bbFlags while duplicating the block #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.
src/jit/flowgraph.cpp
src/jit/objectalloc.cpp