diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2015-04-14 17:05:16 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2015-04-15 09:37:01 +0100 |
commit | 95bf7547986e68d4ac93b0a529aaa8eb3c998c1f (patch) | |
tree | 7865118be29c02ccbfdb893277a40f1a2557918f /compiler/optimizing/locations.h | |
parent | 85806723695120d183e85e9d12d52340b839b781 (diff) | |
download | android_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.h | 6 |
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. |