diff options
author | Chao-ying Fu <chao-ying.fu@intel.com> | 2014-03-27 14:17:28 -0700 |
---|---|---|
committer | buzbee <buzbee@google.com> | 2014-03-27 15:55:11 -0700 |
commit | 3d325c6700509c37d85f21a94575d7605812e806 (patch) | |
tree | 633e04019c357b281043edfd594b2642618541ac /compiler/dex/quick/ralloc_util.cc | |
parent | 0fd52d5d0cf01e5a109851098a43a79f5615dc0f (diff) | |
download | android_art-3d325c6700509c37d85f21a94575d7605812e806.tar.gz android_art-3d325c6700509c37d85f21a94575d7605812e806.tar.bz2 android_art-3d325c6700509c37d85f21a94575d7605812e806.zip |
Fix CopyRegInfo to keep live/dirty flags of new registers.
CopyRegInfo should not change live/dirty flags of new registgers.
Otherwise, it will lead to incorrectly clobbering these live registers
that are not live actually, and then allocating them to another usage.
Change-Id: Ia9f055b33a11a6d70c0aca1a9fe8639ecfb09464
Signed-off-by: Chao-ying Fu <chao-ying.fu@intel.com>
Diffstat (limited to 'compiler/dex/quick/ralloc_util.cc')
-rw-r--r-- | compiler/dex/quick/ralloc_util.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/dex/quick/ralloc_util.cc b/compiler/dex/quick/ralloc_util.cc index 137d5eb61e..39783a21ea 100644 --- a/compiler/dex/quick/ralloc_util.cc +++ b/compiler/dex/quick/ralloc_util.cc @@ -743,11 +743,15 @@ void Mir2Lir::MarkInUse(RegStorage reg) { void Mir2Lir::CopyRegInfo(int new_reg, int old_reg) { RegisterInfo* new_info = GetRegInfo(new_reg); RegisterInfo* old_info = GetRegInfo(old_reg); - // Target temp status must not change + // Target temp, live, dirty status must not change bool is_temp = new_info->is_temp; + bool live = new_info->live; + bool dirty = new_info->dirty; *new_info = *old_info; - // Restore target's temp status + // Restore target's temp, live, dirty status new_info->is_temp = is_temp; + new_info->live = live; + new_info->dirty = dirty; new_info->reg = new_reg; } |