From 21cc798cd56a069a3d51a0215020676065780939 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Mon, 17 Nov 2014 17:50:33 +0000 Subject: Fix a bug in the type propagation phase of optimizing. The compiler was placing phis (and their floating point equivalent), in a way that it did not expect. Change-Id: I974be1ee4aae5d27d68c6bba171db0ed25377b70 --- compiler/optimizing/ssa_builder.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'compiler/optimizing/ssa_builder.cc') diff --git a/compiler/optimizing/ssa_builder.cc b/compiler/optimizing/ssa_builder.cc index fec40f93c7..b2cc11996e 100644 --- a/compiler/optimizing/ssa_builder.cc +++ b/compiler/optimizing/ssa_builder.cc @@ -183,8 +183,7 @@ static HDoubleConstant* GetDoubleEquivalent(HLongConstant* constant) { static HPhi* GetFloatOrDoubleEquivalentOfPhi(HPhi* phi, Primitive::Type type) { // We place the floating point phi next to this phi. HInstruction* next = phi->GetNext(); - if (next == nullptr - || (next->GetType() != Primitive::kPrimDouble && next->GetType() != Primitive::kPrimFloat)) { + if (next == nullptr || (next->AsPhi()->GetRegNumber() != phi->GetRegNumber())) { ArenaAllocator* allocator = phi->GetBlock()->GetGraph()->GetArena(); HPhi* new_phi = new (allocator) HPhi(allocator, phi->GetRegNumber(), phi->InputCount(), type); for (size_t i = 0, e = phi->InputCount(); i < e; ++i) { @@ -195,9 +194,7 @@ static HPhi* GetFloatOrDoubleEquivalentOfPhi(HPhi* phi, Primitive::Type type) { phi->GetBlock()->InsertPhiAfter(new_phi, phi); return new_phi; } else { - // If there is already a phi with the expected type, we know it is the floating - // point equivalent of this phi. - DCHECK_EQ(next->AsPhi()->GetRegNumber(), phi->GetRegNumber()); + DCHECK_EQ(next->GetType(), type); return next->AsPhi(); } } -- cgit v1.2.3-59-g8ed1b