summaryrefslogtreecommitdiffstats
path: root/compiler
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2015-08-07 18:13:03 -0700
committerNicolas Geoffray <ngeoffray@google.com>2015-08-08 14:43:41 -0700
commit6e9c66e099654b63ed3648bda2daeaf0a862f047 (patch)
tree02e1640e4b4040a5133e27cd127403fea8f3cfdf /compiler
parentd333389cf635e002658a77e64547631e05004447 (diff)
downloadart-6e9c66e099654b63ed3648bda2daeaf0a862f047.zip
art-6e9c66e099654b63ed3648bda2daeaf0a862f047.tar.gz
art-6e9c66e099654b63ed3648bda2daeaf0a862f047.tar.bz2
Fix a bug in the register allocator around pair allocation.
We may get hints that do not work with the current implementation of register pairs, which forces the allocation of (low + 1) for the high register. For example, if the hint is EBX, we will allocate ESP for the high register. bug:23043730 (cherry picked from commit f29758111e71a7d14f3e52d78773561a5d59961f) Change-Id: Ib395e36616017a87d3055218d72417f4e9ff6501
Diffstat (limited to 'compiler')
-rw-r--r--compiler/optimizing/register_allocator.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/optimizing/register_allocator.cc b/compiler/optimizing/register_allocator.cc
index 8656ad5..d64e146 100644
--- a/compiler/optimizing/register_allocator.cc
+++ b/compiler/optimizing/register_allocator.cc
@@ -772,7 +772,10 @@ bool RegisterAllocator::TryAllocateFreeReg(LiveInterval* current) {
} else {
DCHECK(!current->IsHighInterval());
int hint = current->FindFirstRegisterHint(free_until, liveness_);
- if (hint != kNoRegister) {
+ if ((hint != kNoRegister)
+ // For simplicity, if the hint we are getting for a pair cannot be used,
+ // we are just going to allocate a new pair.
+ && !(current->IsLowInterval() && IsBlocked(GetHighForLowRegister(hint)))) {
DCHECK(!IsBlocked(hint));
reg = hint;
} else if (current->IsLowInterval()) {