[pypy-svn] r67463 - in pypy/branch/no-recompilation/pypy/jit/backend/x86: . test

fijal at codespeak.net fijal at codespeak.net
Thu Sep 3 20:04:39 CEST 2009


Author: fijal
Date: Thu Sep  3 20:04:38 2009
New Revision: 67463

Modified:
   pypy/branch/no-recompilation/pypy/jit/backend/x86/regalloc.py
   pypy/branch/no-recompilation/pypy/jit/backend/x86/test/test_regalloc.py
Log:
A test and a fix


Modified: pypy/branch/no-recompilation/pypy/jit/backend/x86/regalloc.py
==============================================================================
--- pypy/branch/no-recompilation/pypy/jit/backend/x86/regalloc.py	(original)
+++ pypy/branch/no-recompilation/pypy/jit/backend/x86/regalloc.py	Thu Sep  3 20:04:38 2009
@@ -94,7 +94,7 @@
         for i in range(len(locs)):
             v = args[i]
             loc = locs[i]
-            if isinstance(loc, REG):
+            if isinstance(loc, REG) and self.longevity[v][1] > -1:
                 self.reg_bindings[v] = loc
                 used[loc] = None
             else:

Modified: pypy/branch/no-recompilation/pypy/jit/backend/x86/test/test_regalloc.py
==============================================================================
--- pypy/branch/no-recompilation/pypy/jit/backend/x86/test/test_regalloc.py	(original)
+++ pypy/branch/no-recompilation/pypy/jit/backend/x86/test/test_regalloc.py	Thu Sep  3 20:04:38 2009
@@ -371,6 +371,24 @@
         assert self.getint(0) == 0
         assert self.getint(1) == 10
 
+    def test_nested_unused_arg(self):
+        ops = '''
+        [i0, i1]
+        guard_true(i0)
+           fail(i0, i1)
+        fail(1)
+        '''
+        loop = self.interpret(ops, [0, 1])
+        assert self.getint(0) == 0
+        bridge_ops = '''
+        [i0, i1]
+        fail(1, 2)
+        '''
+        self.attach_bridge(bridge_ops, loop, loop.operations[0])
+        self.cpu.set_future_value_int(0, 0)
+        self.cpu.set_future_value_int(1, 1)
+        self.cpu.execute_operations(loop)
+
     def test_spill_for_constant(self):
         ops = '''
         [i0, i1, i2, i3]



More information about the Pypy-commit mailing list