Use ResetDef to prevent from removing necessary stores for x86 long-to-fp.
X86 long-to-fp needs the source operand in the memory.
Later on, NullifyRange may remove the stores and then lead to incorrect
long-to-fp conversions.
To fix this bug, ResetDef is called after flushing source to the memory
for x86 long-to-fp.
Change-Id: I3510739294dc2e5ffb3d76d7651880fae63f2382
Signed-off-by: Chao-ying Fu <chao-ying.fu@intel.com>
diff --git a/compiler/dex/quick/x86/fp_x86.cc b/compiler/dex/quick/x86/fp_x86.cc
index ec4d9db..3fb9012 100644
--- a/compiler/dex/quick/x86/fp_x86.cc
+++ b/compiler/dex/quick/x86/fp_x86.cc
@@ -146,6 +146,11 @@
if (lo_info != nullptr && lo_info->is_temp) {
// Calling FlushSpecificReg because it will only write back VR if it is dirty.
FlushSpecificReg(lo_info);
+ // ResetDef for low/high to prevent NullifyRange from removing stores.
+ ResetDef(rl_src.reg.GetLowReg());
+ if (rl_src.reg.GetLowReg() != rl_src.reg.GetHighReg() && GetRegInfo(rl_src.reg.GetHighReg()) != nullptr) {
+ ResetDef(rl_src.reg.GetHighReg());
+ }
} else {
// It must have been register promoted if it is not a temp but is still in physical
// register. Since we need it to be in memory to convert, we place it there now.