diff options
author | Chao-ying Fu <chao-ying.fu@intel.com> | 2014-03-28 18:14:36 -0700 |
---|---|---|
committer | Chao-ying Fu <chao-ying.fu@intel.com> | 2014-03-28 18:26:24 -0700 |
commit | 6170f5576f46f64eec6cd6c125c3de001afa5bcf (patch) | |
tree | b2ddd63de35871714e32aeec2c76c9caef0a8dd6 | |
parent | 2bc4246f3dc045036da962a326b6f0b70541c2c8 (diff) | |
download | art-6170f5576f46f64eec6cd6c125c3de001afa5bcf.tar.gz art-6170f5576f46f64eec6cd6c125c3de001afa5bcf.tar.bz2 art-6170f5576f46f64eec6cd6c125c3de001afa5bcf.zip |
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>
-rw-r--r-- | compiler/dex/quick/x86/fp_x86.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/dex/quick/x86/fp_x86.cc b/compiler/dex/quick/x86/fp_x86.cc index ec4d9db0bb..3fb901216d 100644 --- a/compiler/dex/quick/x86/fp_x86.cc +++ b/compiler/dex/quick/x86/fp_x86.cc @@ -146,6 +146,11 @@ void X86Mir2Lir::GenLongToFP(RegLocation rl_dest, RegLocation rl_src, bool is_do 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. |