summaryrefslogtreecommitdiff
path: root/src/compiler/codegen/MethodCodegenDriver.cc
diff options
context:
space:
mode:
author buzbee <buzbee@google.com> 2012-03-14 17:37:27 -0700
committer buzbee <buzbee@google.com> 2012-03-14 17:53:18 -0700
commit3d661949dba4a2f3311e6f74a3c42b5addf1f534 (patch)
treed8fd2c903fe425bb65a92a7ee9f72a1e57cf5045 /src/compiler/codegen/MethodCodegenDriver.cc
parentfb84494fc1888b92e938ece850990668073a276b (diff)
Real fix for 064
The recent ssa cleanup CL surfaced a somewhat subtle bug in live register tracking. The code generation register utilities attempt to remember and reuse live Dalvik register values for future use. This remembering takes place in the storeValueXX() code. For this to work, though, storeValue may only be called once during the compilation of any single Dalvik instruction. However, the code generation routine for CONST_CLASS included a somewhat complicated slow path with iternal branches and two generated "storeValue" locations. This resulted in downstream code expecting to find a live value in the wrong place. This fix is to note this special case and do a "clobber" on the ssa name. This CL also includes some sanity checking code that can detect multiple calls to storeValue during one intruction compilation to try to catch this situation in the future. Change-Id: I66a279140accd80cda83f66efe570c9702fb351b
Diffstat (limited to 'src/compiler/codegen/MethodCodegenDriver.cc')
-rw-r--r--src/compiler/codegen/MethodCodegenDriver.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/codegen/MethodCodegenDriver.cc b/src/compiler/codegen/MethodCodegenDriver.cc
index 5baabf2f32..6aa6366588 100644
--- a/src/compiler/codegen/MethodCodegenDriver.cc
+++ b/src/compiler/codegen/MethodCodegenDriver.cc
@@ -795,6 +795,11 @@ bool methodBlockCodeGen(CompilationUnit* cUnit, BasicBlock* bb)
oatResetDefTracking(cUnit);
}
+#ifndef NDEBUG
+ /* Reset temp tracking sanity check */
+ cUnit->liveSReg = INVALID_SREG;
+#endif
+
if ((int)mir->dalvikInsn.opcode >= (int)kMirOpFirst) {
handleExtendedMethodMIR(cUnit, mir);
continue;