Index: /branches/x8664-call/ccl/compiler/X86/x86-lapmacros.lisp
===================================================================
--- /branches/x8664-call/ccl/compiler/X86/x86-lapmacros.lisp	(revision 6298)
+++ /branches/x8664-call/ccl/compiler/X86/x86-lapmacros.lisp	(revision 6299)
@@ -276,7 +276,4 @@
   `(jmp (% ra0)))
 
-(defx86lapmacro recover-fn-from-ra0 (here)
-  `(leaq (@ (- (:^ ,here)) (% ra0)) (% fn)))
-
 ;;; Using *x8664-backend* here is wrong but expedient.
 (defun x86-subprim-offset (name)
@@ -291,11 +288,13 @@
 
 (defx86lapmacro call-subprim (name &optional (recover-fn t))
-  (let* ((label (gensym)))
+  (declare (ignore recover-fn))
+  (let* ((label (gensym))
+         (post (gensym)))
     `(progn
       (leaq (@ (:^ ,label) (% fn)) (% ra0))
       (jmp-subprim ,name)
       (:tra ,label)
-      ,@(if recover-fn
-            `((recover-fn-from-ra0 ,label))))))
+      (lea (@ (- (:^ ,post)) (% rip)) (% fn))
+      ,post)))
      
 (defx86lapmacro %car (src dest)
@@ -320,5 +319,6 @@
 ;;; to return a single value.
 (defx86lapmacro call-symbol (name nargs)
-  (let* ((return (gensym)))
+  (let* ((return (gensym))
+         (post (gensym)))
     `(progn
       (load-constant ,name fname)
@@ -328,5 +328,12 @@
       (jmp (% fn))
       (:tra ,return)
-      (recover-fn-from-ra0 ,return))))
+      (lea (@ (- (:^ ,post)) (% rip)) (% fn))
+      ,post)))
+
+(defx86lapmacro recover-fn-from-rip ()
+  (let* ((next (gensym)))
+    `(progn
+      (lea (@ (- (:^ ,next)) (% rip)) (% fn))
+      ,next)))
 
 ;;;  tail call the function named by NAME with nargs NARGS.  %FN is
