Fix bug: inlinee did not copy inlinee bbFlags to caller bbFlags.
authorEgor Chesakov <t-egche@microsoft.com>
Tue, 19 Jul 2016 18:33:19 +0000 (11:33 -0700)
committerEgor Chesakov <t-egche@microsoft.com>
Wed, 20 Jul 2016 23:00:21 +0000 (16:00 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/45cff6169b2ec915f1aae567a9581f0e3265de39

src/coreclr/src/jit/block.h
src/coreclr/src/jit/flowgraph.cpp

index 08d6d3d..92f9f01 100644 (file)
@@ -372,10 +372,10 @@ struct BasicBlock
 
 // TODO: Should BBF_RUN_RARELY be added to BBF_SPLIT_GAINED ?
 
-#define BBF_SPLIT_GAINED   (BBF_DONT_REMOVE | BBF_HAS_LABEL |                    \
+#define BBF_SPLIT_GAINED   (BBF_DONT_REMOVE | BBF_HAS_LABEL     |                \
                             BBF_HAS_JMP     | BBF_BACKWARD_JUMP |                \
-                            BBF_HAS_INDX    | BBF_HAS_NEWARRAY                 \
-                            BBF_PROF_WEIGHT |                                    \
+                            BBF_HAS_INDX    | BBF_HAS_NEWARRAY  |                \
+                            BBF_PROF_WEIGHT | BBF_HAS_NEWOBJ    |                \
                             BBF_KEEP_BBJ_ALWAYS)
 
 #ifndef __GNUC__ // GCC doesn't like C_ASSERT at global scope
index ed2e6f2..3f64230 100644 (file)
@@ -22012,6 +22012,12 @@ void Compiler::fgInsertInlineeBlocks(InlineInfo* pInlineInfo)
                 stmtAfter = fgInsertStmtListAfter(iciBlock,
                                                   stmtAfter,
                                                   InlineeCompiler->fgFirstBB->bbTreeList);
+
+                // Copy inlinee bbFlags to caller bbFlags.
+                const unsigned int inlineeBlockFlags = InlineeCompiler->fgFirstBB->bbFlags;
+                noway_assert((inlineeBlockFlags & BBF_HAS_JMP) == 0);
+                noway_assert((inlineeBlockFlags & BBF_KEEP_BBJ_ALWAYS) == 0);
+                iciBlock->bbFlags |= inlineeBlockFlags;
             }
 #ifdef DEBUG
             if (verbose)