[pypy-svn] r37659 - pypy/dist/pypy/jit/codegen/ppc

mwh at codespeak.net mwh at codespeak.net
Wed Jan 31 12:20:31 CET 2007


Author: mwh
Date: Wed Jan 31 12:20:30 2007
New Revision: 37659

Modified:
   pypy/dist/pypy/jit/codegen/ppc/instruction.py
   pypy/dist/pypy/jit/codegen/ppc/rgenop.py
Log:
properly fix the latest batch of bugs seen in random testing -- the real
problem seems to have been recording positions of arguments at a label
intertwined with moving things out of the condition register, which of course
may affect the positions already recorded...

revert my last "fix" which indeed only helped a particular case by chance


Modified: pypy/dist/pypy/jit/codegen/ppc/instruction.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/ppc/instruction.py	(original)
+++ pypy/dist/pypy/jit/codegen/ppc/instruction.py	Wed Jan 31 12:20:30 2007
@@ -482,7 +482,6 @@
         self.result = None
         self.label = label
     def allocate(self, allocator):
-        self.label.arg_locations = []
         for gv in self.label.args_gv:
             loc = allocator.loc_of(gv)
             if isinstance(loc, CRF):
@@ -493,6 +492,9 @@
                 allocator.lru.append(gv)
                 allocator.insns.append(loc.move_to_gpr(allocator, new_loc.number))
                 loc = new_loc
+        self.label.arg_locations = []
+        for gv in self.label.args_gv:
+            loc = allocator.loc_of(gv)
             self.label.arg_locations.append(loc)
         allocator.labels_to_tell_spill_offset_to.append(self.label)
     def __repr__(self):

Modified: pypy/dist/pypy/jit/codegen/ppc/rgenop.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/ppc/rgenop.py	(original)
+++ pypy/dist/pypy/jit/codegen/ppc/rgenop.py	Wed Jan 31 12:20:30 2007
@@ -360,8 +360,10 @@
         for i in range(len(args_gv)):
             gv = args_gv[i]
             if isinstance(gv, Var):
-                new_gv = self._arg_op(gv, _PPC.mr)
-                args_gv[i] = new_gv
+                if gv in seen:
+                    new_gv = self._arg_op(gv, _PPC.mr)
+                    args_gv[i] = new_gv
+                seen[gv] = True
             else:
                 new_gv = Var()
                 gv.load(self.insns, new_gv)



More information about the Pypy-commit mailing list