Quick: Fix a DCHECK to take type conflicts into account.
Bug: 21865466
Change-Id: I010c7058b5a58bea1ec61af5bd6a12c2eb8de1b4
diff --git a/compiler/dex/quick/gen_loadstore.cc b/compiler/dex/quick/gen_loadstore.cc
index aa95e77..3f89001 100644
--- a/compiler/dex/quick/gen_loadstore.cc
+++ b/compiler/dex/quick/gen_loadstore.cc
@@ -107,7 +107,9 @@
}
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)) {