[pypy-commit] pypy default: Test and fix.

arigo noreply at buildbot.pypy.org
Sat Aug 13 19:06:17 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r46481:678a28dd058f
Date: 2011-08-13 18:58 +0200
http://bitbucket.org/pypy/pypy/changeset/678a28dd058f/

Log:	Test and fix.

diff --git a/pypy/translator/c/gcc/test/elf64/track_zero_4.s b/pypy/translator/c/gcc/test/elf64/track_zero_4.s
new file mode 100644
--- /dev/null
+++ b/pypy/translator/c/gcc/test/elf64/track_zero_4.s
@@ -0,0 +1,18 @@
+	.type	pypy_g_do_call_1, @function
+pypy_g_do_call_1:
+	pushq	%rbx
+	pushq	%r12
+	movq	%rdi, %rbx
+	movq	%rsi, %r12
+	call	number1
+	;; expected {16(%rsp) | 8(%rsp), (%rsp), %r13, %r14, %r15, %rbp | %r12}
+	testq	%rbx, %rbx
+	movq	%r12, %rbx
+	je .L1
+	movq	(%rax), %rbx
+.L1:
+	/* GCROOT %rbx */
+	popq	%r12
+	popq	%rbx
+	ret
+	.size	pypy_g_do_call_1, .-pypy_g_do_call_1
diff --git a/pypy/translator/c/gcc/trackgcroot.py b/pypy/translator/c/gcc/trackgcroot.py
--- a/pypy/translator/c/gcc/trackgcroot.py
+++ b/pypy/translator/c/gcc/trackgcroot.py
@@ -163,6 +163,9 @@
         # Add the instruction to the list, and link it to the previous one.
         previnsn = self.insns[-1]
         self.insns.append(insn)
+        if (isinstance(insn, (InsnSetLocal, InsnCopyLocal)) and
+            insn.target == self.tested_for_zero):
+            self.tested_for_zero = None
 
         try:
             lst = insn.previous_insns


More information about the pypy-commit mailing list