Skip to content

Commit 9858df5

Browse files
committed
Assert equal numbers of Start/End internal control flow labels
If the number of Start internal control flow labels does not equal the number of End internal control flow labels, the result might be subtle intermittent problems related to register allocation. This change adds an assertion that, at the completion of the Register Allocation Phase, the register allocator must not indicate that it's still nested within a region of internal control flow nor popped out of too many regions of internal control flow. Signed-off-by: Henry Zongaro <[email protected]>
1 parent 6bfb20f commit 9858df5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler/codegen/OMRCodeGenPhase.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,8 @@ OMR::CodeGenPhase::performRegisterAssigningPhase(TR::CodeGenerator * cg, TR::Cod
391391
cg->jettisonAllSpills(); // Spill temps used before now may lead to conflicts if also used by register assignment
392392
cg->doRegisterAssignment(kindsToAssign);
393393

394+
TR_ASSERT_FATAL(cg->internalControlFlowNestingDepth() == 0, "The numbers of labels marked as Start or End of internal control flow were unequal: internalControlFlowNestingDepth == %d\n", cg->internalControlFlowNestingDepth());
395+
394396
if (comp->compilationShouldBeInterrupted(AFTER_REGISTER_ASSIGNMENT_CONTEXT))
395397
{
396398
comp->failCompilation<TR::CompilationInterrupted>("interrupted after RA");

0 commit comments

Comments
 (0)