Fix IP register usage in LoadClassSlowPathARMVIXL.
Request a temporary from a UseScratchRegisterScope instead
of explicitly specifying the IP register to avoid assetion
failure in VIXL.
Test: Build aosp_flounder-userdebug with ART_USE_VIXL_ARM_BACKEND=true
Bug: 34340177
Bug: 30627598
Change-Id: Ie39fbbb66165d752634cde8d2963129641558b93
diff --git a/compiler/optimizing/code_generator_arm_vixl.cc b/compiler/optimizing/code_generator_arm_vixl.cc
index 83c289e..f496d29 100644
--- a/compiler/optimizing/code_generator_arm_vixl.cc
+++ b/compiler/optimizing/code_generator_arm_vixl.cc
@@ -431,10 +431,12 @@
// TODO: Change art_quick_initialize_type/art_quick_initialize_static_storage to
// kSaveEverything and use a temporary for the .bss entry address in the fast path,
// so that we can avoid another calculation here.
+ UseScratchRegisterScope temps(down_cast<CodeGeneratorARMVIXL*>(codegen)->GetVIXLAssembler());
+ vixl32::Register temp = temps.Acquire();
CodeGeneratorARMVIXL::PcRelativePatchInfo* labels =
arm_codegen->NewTypeBssEntryPatch(cls_->GetDexFile(), type_index);
- arm_codegen->EmitMovwMovtPlaceholder(labels, ip);
- __ Str(OutputRegister(cls_), MemOperand(ip));
+ arm_codegen->EmitMovwMovtPlaceholder(labels, temp);
+ __ Str(OutputRegister(cls_), MemOperand(temp));
}
__ B(GetExitLabel());
}