From 95bf7547986e68d4ac93b0a529aaa8eb3c998c1f Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Tue, 14 Apr 2015 17:05:16 +0100 Subject: [PATCH] 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 --- compiler/optimizing/locations.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/optimizing/locations.h b/compiler/optimizing/locations.h index de876be9a..b36e574db 100644 --- a/compiler/optimizing/locations.h +++ b/compiler/optimizing/locations.h @@ -486,11 +486,17 @@ class LocationSummary : public ArenaObject { 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. -- 2.11.0