Author: Hakan Ardo <[email protected]>
Branch: 
Changeset: r54895:a99ae0b598c9
Date: 2012-05-05 09:29 +0200
http://bitbucket.org/pypy/pypy/changeset/a99ae0b598c9/

Log:    If optimization steps are dissabled we might not be able to optimize
        out the entire short preamble from the end of its peeled loop. In
        that case, the ops that remains might force the short preamble to be
        extened with additional ops

diff --git a/pypy/jit/metainterp/optimizeopt/unroll.py 
b/pypy/jit/metainterp/optimizeopt/unroll.py
--- a/pypy/jit/metainterp/optimizeopt/unroll.py
+++ b/pypy/jit/metainterp/optimizeopt/unroll.py
@@ -335,9 +335,13 @@
                                       
             args[short_inputargs[i]] = jmp_to_short_args[i]
         self.short_inliner = Inliner(short_inputargs, jmp_to_short_args)
-        for op in self.short[1:]:
+        i = 1
+        while i < len(self.short):
+            # Note that self.short might be extended during this loop
+            op = self.short[i]
             newop = self.short_inliner.inline_op(op)
             self.optimizer.send_extra_operation(newop)
+            i += 1
 
         # Import boxes produced in the preamble but used in the loop
         newoperations = self.optimizer.get_newoperations()
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to