Skip to content

Commit

Permalink
Avoid zeroing out spilled register lists for OOL
Browse files Browse the repository at this point in the history
This fixes a tricky bug which is detailed in #5977. See the
aforementioned issue for a full explanation.
  • Loading branch information
fjeremic committed Apr 30, 2021
1 parent 6ed62c2 commit 7d3ca8f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions compiler/codegen/OMRCodeGenerator.cpp
Expand Up @@ -844,11 +844,14 @@ OMR::CodeGenerator::doRegisterAssignment(TR_RegisterKinds kindsToAssign)
TR::Instruction *prevInstr = NULL;
TR::Instruction *currInstr = self()->getAppendInstruction();

auto *firstTimeLiveOOLRegisterList = new (self()->trHeapMemory()) TR::list<TR::Register*>(getTypedAllocator<TR::Register*>(self()->comp()->allocator()));
self()->setFirstTimeLiveOOLRegisterList(firstTimeLiveOOLRegisterList);
if (!self()->isOutOfLineColdPath())
{
auto *firstTimeLiveOOLRegisterList = new (self()->trHeapMemory()) TR::list<TR::Register*>(getTypedAllocator<TR::Register*>(self()->comp()->allocator()));
self()->setFirstTimeLiveOOLRegisterList(firstTimeLiveOOLRegisterList);

auto *spilledRegisterList = new (self()->trHeapMemory()) TR::list<TR::Register*>(getTypedAllocator<TR::CFGEdge*>(self()->comp()->allocator()));
self()->setSpilledRegisterList(spilledRegisterList);
auto *spilledRegisterList = new (self()->trHeapMemory()) TR::list<TR::Register*>(getTypedAllocator<TR::CFGEdge*>(self()->comp()->allocator()));
self()->setSpilledRegisterList(spilledRegisterList);
}

if (self()->getDebug())
{
Expand Down

0 comments on commit 7d3ca8f

Please sign in to comment.