summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/locations.h
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2015-04-14 17:05:16 +0100
committerNicolas Geoffray <ngeoffray@google.com>2015-04-15 09:37:01 +0100
commit95bf7547986e68d4ac93b0a529aaa8eb3c998c1f (patch)
tree7865118be29c02ccbfdb893277a40f1a2557918f /compiler/optimizing/locations.h
parent85806723695120d183e85e9d12d52340b839b781 (diff)
downloadandroid_art-95bf7547986e68d4ac93b0a529aaa8eb3c998c1f.tar.gz
android_art-95bf7547986e68d4ac93b0a529aaa8eb3c998c1f.tar.bz2
android_art-95bf7547986e68d4ac93b0a529aaa8eb3c998c1f.zip
Add a check in the location summary.
Having SameAsFirstInput for out, and first input Any does not make sense currently. If it's stack, we are going to overwrite it, potentially clobbering another local. And constant does not make sense. Change-Id: I0ce357137487ed3dcecf4efd9922a039a2a1a29d
Diffstat (limited to 'compiler/optimizing/locations.h')
-rw-r--r--compiler/optimizing/locations.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/optimizing/locations.h b/compiler/optimizing/locations.h
index de876be9ab..b36e574db7 100644
--- a/compiler/optimizing/locations.h
+++ b/compiler/optimizing/locations.h
@@ -486,11 +486,17 @@ class LocationSummary : public ArenaObject<kArenaAllocMisc> {
void SetOut(Location location, Location::OutputOverlap overlaps = Location::kOutputOverlap) {
DCHECK(output_.IsInvalid());
+ if (kIsDebugBuild && location.IsUnallocated()) {
+ if ((location.GetPolicy() == Location::kSameAsFirstInput) && InAt(0).IsUnallocated()) {
+ DCHECK_NE(InAt(0).GetPolicy(), Location::kAny);
+ }
+ }
output_overlaps_ = overlaps;
output_ = location;
}
void UpdateOut(Location location) {
+ DCHECK(!location.IsUnallocated());
// There are two reasons for updating an output:
// 1) Parameters, where we only know the exact stack slot after
// doing full register allocation.