OSDN Git Service

Quick: Fix a DCHECK to take type conflicts into account.
authorVladimir Marko <vmarko@google.com>
Sat, 27 Jun 2015 12:44:06 +0000 (13:44 +0100)
committerVladimir Marko <vmarko@google.com>
Sat, 27 Jun 2015 12:56:45 +0000 (13:56 +0100)
Bug: 21865466
Change-Id: I010c7058b5a58bea1ec61af5bd6a12c2eb8de1b4

compiler/dex/quick/gen_loadstore.cc

index aa95e77..3f89001 100644 (file)
@@ -107,7 +107,9 @@ void Mir2Lir::LoadValueDirectWideFixed(RegLocation rl_src, RegStorage r_dest) {
 }
 
 RegLocation Mir2Lir::LoadValue(RegLocation rl_src, RegisterClass op_kind) {
-  DCHECK(!rl_src.ref || op_kind == kRefReg);
+  // If op_kind isn't a reference, rl_src should not be marked as a reference either
+  // unless we've seen type conflicts (i.e. register promotion is disabled).
+  DCHECK(op_kind == kRefReg || (!rl_src.ref || (cu_->disable_opt & (1u << kPromoteRegs)) != 0u));
   rl_src = UpdateLoc(rl_src);
   if (rl_src.location == kLocPhysReg) {
     if (!RegClassMatches(op_kind, rl_src.reg)) {