From 04ce06dc4c9dff4ff7a8b97079e3cbb7b60da3ab Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Fri, 22 Jun 2012 19:51:41 +0000 Subject: [PATCH] Fix a crash in --debug code. Don't try to print out the live range of a physreg. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159021 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/RegisterCoalescer.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/RegisterCoalescer.cpp b/lib/CodeGen/RegisterCoalescer.cpp index 7ef525d9f3c..19b6ffcb51b 100644 --- a/lib/CodeGen/RegisterCoalescer.cpp +++ b/lib/CodeGen/RegisterCoalescer.cpp @@ -1053,8 +1053,12 @@ bool RegisterCoalescer::joinCopy(MachineInstr *CopyMI, bool &Again) { // Update regalloc hint. TRI->UpdateRegAllocHint(CP.getSrcReg(), CP.getDstReg(), *MF); - DEBUG(dbgs() << "\tJoined. Result = " << PrintReg(CP.getDstReg(), TRI) - << ' ' << LIS->getInterval(CP.getDstReg()) << '\n'); + DEBUG({ + dbgs() << "\tJoined. Result = " << PrintReg(CP.getDstReg(), TRI); + if (!CP.isPhys()) + dbgs() << LIS->getInterval(CP.getDstReg()); + dbgs() << '\n'; + }); ++numJoins; return true;