From 3a658077af2a931e5d7f6cd22b777c57112c19df Mon Sep 17 00:00:00 2001 From: buzbee Date: Thu, 28 Aug 2014 13:48:56 -0700 Subject: Quick compiler: Fix MIPS build In debug builds, the Quick compiler frequently runs a sanity checker over the register pool. Among other things, it attempts to verify consistent representation of register pairs. However, a register's "wide" flag is meaningful only when the register pair is associated with a Dalvik wide value (sreg != INVALID_SREG) rather than a temp wide value. The MIPS build was tripping over this bad assertion. Fixed here. Note related cl/105461 Change-Id: Id726ff1ea0f5cbcc8dba6fa3aacb3fd4fc043a63 --- compiler/dex/quick/ralloc_util.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'compiler') diff --git a/compiler/dex/quick/ralloc_util.cc b/compiler/dex/quick/ralloc_util.cc index 0a737a9315..195da0dad2 100644 --- a/compiler/dex/quick/ralloc_util.cc +++ b/compiler/dex/quick/ralloc_util.cc @@ -934,9 +934,9 @@ void Mir2Lir::MarkInUse(RegStorage reg) { bool Mir2Lir::CheckCorePoolSanity() { GrowableArray::Iterator it(&tempreg_info_); for (RegisterInfo* info = it.Next(); info != nullptr; info = it.Next()) { - if (info->IsTemp() && info->IsLive() && info->IsWide()) { + int my_sreg = info->SReg(); + if (info->IsTemp() && info->IsLive() && info->IsWide() && my_sreg != INVALID_SREG) { RegStorage my_reg = info->GetReg(); - int my_sreg = info->SReg(); RegStorage partner_reg = info->Partner(); RegisterInfo* partner = GetRegInfo(partner_reg); DCHECK(partner != NULL); @@ -944,12 +944,8 @@ bool Mir2Lir::CheckCorePoolSanity() { DCHECK_EQ(my_reg.GetReg(), partner->Partner().GetReg()); DCHECK(partner->IsLive()); int partner_sreg = partner->SReg(); - if (my_sreg == INVALID_SREG) { - DCHECK_EQ(partner_sreg, INVALID_SREG); - } else { - int diff = my_sreg - partner_sreg; - DCHECK((diff == 0) || (diff == -1) || (diff == 1)); - } + int diff = my_sreg - partner_sreg; + DCHECK((diff == 0) || (diff == -1) || (diff == 1)); } if (info->Master() != info) { // Aliased. -- cgit v1.2.3