summaryrefslogtreecommitdiff
path: root/compiler/optimizing/graph_checker.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2015-12-15 14:11:59 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2015-12-16 12:22:20 +0000
commitf5f64efda943000168d34bfe44ccbbadd284e55f (patch)
tree7364ec231d39291af44245dc16b0ca48919862d0 /compiler/optimizing/graph_checker.cc
parent74768fb83073a2ae84c9173d4fc53654e3092b24 (diff)
Detect phi cycles.
Having reference and non-reference phi equivalent, only happened for the 0/null constant. To avoid such occurences, we must detect phi cycles. bug:25493693 Change-Id: Ie1a8460c3abacca96c299da107fa4407e17dd792
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
-rw-r--r--compiler/optimizing/graph_checker.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc
index f3c1dbe3f5..3b93b2b571 100644
--- a/compiler/optimizing/graph_checker.cc
+++ b/compiler/optimizing/graph_checker.cc
@@ -763,6 +763,14 @@ void SSAChecker::VisitPhi(HPhi* phi) {
phi->GetId(),
phi->GetRegNumber(),
type_str.str().c_str()));
+ } else if (phi->GetType() == Primitive::kPrimNot) {
+ std::stringstream type_str;
+ type_str << other_phi->GetType();
+ AddError(StringPrintf(
+ "Equivalent non-reference phi (%d) found for VReg %d with type: %s.",
+ phi->GetId(),
+ phi->GetRegNumber(),
+ type_str.str().c_str()));
} else {
ArenaBitVector visited(GetGraph()->GetArena(), 0, /* expandable */ true);
if (!IsConstantEquivalent(phi, other_phi, &visited)) {