[pypy-svn] r37403 - pypy/dist/pypy/jit/codegen/i386

arigo at codespeak.net arigo at codespeak.net
Fri Jan 26 18:44:55 CET 2007


Author: arigo
Date: Fri Jan 26 18:44:53 2007
New Revision: 37403

Modified:
   pypy/dist/pypy/jit/codegen/i386/regalloc.py
Log:
Nasty bug squashed.


Modified: pypy/dist/pypy/jit/codegen/i386/regalloc.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/i386/regalloc.py	(original)
+++ pypy/dist/pypy/jit/codegen/i386/regalloc.py	Fri Jan 26 18:44:53 2007
@@ -157,11 +157,15 @@
         operands = []
         seen_regs = 0
         seen_stackn = {}
+        last_seen_stackn = -1
         for op in force_loc2operand.values():
             if isinstance(op, REG):
                 seen_regs |= 1 << op.op
             elif isinstance(op, MODRM):
-                seen_stackn[stack_n_from_op(op)] = None
+                n = stack_n_from_op(op)
+                seen_stackn[n] = None
+                if n > last_seen_stackn:
+                    last_seen_stackn = n
         i = 0
         stackn = 0
         num_stack_locs = self.num_stack_locs
@@ -186,6 +190,8 @@
                     stackn += 1
             operands.append(operand)
         self.operands = operands
+        if stackn <= last_seen_stackn:
+            stackn = last_seen_stackn + 1
         self.required_frame_depth = stackn
 
     def get_operand(self, gv_source):



More information about the Pypy-commit mailing list