Author: Armin Rigo <[email protected]>
Branch: use-gcc
Changeset: r1778:4fa472ff2656
Date: 2015-05-24 18:18 +0200
http://bitbucket.org/pypy/stmgc/changeset/4fa472ff2656/

Log:    Give up and document the gcc-only restriction

diff --git a/c7/stmgc.h b/c7/stmgc.h
--- a/c7/stmgc.h
+++ b/c7/stmgc.h
@@ -311,7 +311,12 @@
 
 /* At some key places, like the entry point of the thread and in the
    function with the interpreter's dispatch loop, you need to declare
-   a local variable of type 'rewind_jmp_buf' and call these macros. */
+   a local variable of type 'rewind_jmp_buf' and call these macros.
+   IMPORTANT: a function in which you call stm_rewind_jmp_enterframe()
+   must never change the value of its own arguments!  If they are
+   passed on the stack, gcc can change the value directly there, but
+   we're missing the logic to save/restore this part!
+*/
 #define stm_rewind_jmp_enterprepframe(tl, rjbuf)   \
     rewind_jmp_enterprepframe(&(tl)->rjthread, rjbuf, (tl)->shadowstack)
 #define stm_rewind_jmp_enterframe(tl, rjbuf)       \
diff --git a/c7/test/test_rewind.c b/c7/test/test_rewind.c
--- a/c7/test/test_rewind.c
+++ b/c7/test/test_rewind.c
@@ -174,12 +174,26 @@
 void foo(int *x) { ++*x; }
 
 __attribute__((noinline))
-void f6(int a1, int a2, int a3, int a4, int a5, int a6, int a7,
-        int a8, int a9, int a10, int a11, int a12, int a13)
+void f6(int c1, int c2, int c3, int c4, int c5, int c6, int c7,
+        int c8, int c9, int c10, int c11, int c12, int c13)
 {
     rewind_jmp_buf buf;
     rewind_jmp_enterframe(&gthread, &buf, NULL);
 
+    int a1 = c1;
+    int a2 = c2;
+    int a3 = c3;
+    int a4 = c4;
+    int a5 = c5;
+    int a6 = c6;
+    int a7 = c7;
+    int a8 = c8;
+    int a9 = c9;
+    int a10 = c10;
+    int a11 = c11;
+    int a12 = c12;
+    int a13 = c13;
+
     rewind_jmp_setjmp(&gthread, NULL);
     gevent(a1); gevent(a2); gevent(a3); gevent(a4);
     gevent(a5); gevent(a6); gevent(a7); gevent(a8);
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to