From: Nikodemus S. <de...@us...> - 2008-03-05 15:11:26
|
Update of /cvsroot/sbcl/sbcl/src/compiler/x86 In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6648/src/compiler/x86 Modified Files: call.lisp nlx.lisp values.lisp Log Message: 1.0.15.15: reset DF on x86 and x86-64 after every STD instead of when calling out * Both the old and the new behaviour should be correct re C-ABI, but this is much easier to audit. Thanks to Aurelien Jarno for the initial patch. * This should also fix the build on platforms with GCC 4.3 compiled libc signal handling functions, which assume DF to be cleared. ** NOTE ** If kernel/libc does not arrange for DF to be cleared before calling our handler and restore it afterwards, we can still be broken by asynch signals on post 4.3 GCC libcs -- but this Is Not Our Fault, We Think. * Test-case suggested by Alistair Bridgewater for possible related default-unknown-values problems on SunOS. Index: call.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/compiler/x86/call.lisp,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- call.lisp 6 May 2007 17:56:28 -0000 1.38 +++ call.lisp 5 Mar 2008 15:11:19 -0000 1.39 @@ -364,7 +364,8 @@ ;; Restore EDI, and reset the stack. (emit-label restore-edi) (loadw edi-tn ebx-tn (frame-word-offset 1)) - (inst mov esp-tn ebx-tn)))) + (inst mov esp-tn ebx-tn) + (inst cld)))) (values)) ;;;; unknown values receiving @@ -1376,7 +1377,8 @@ (inst sub ecx 1) (inst jmp :nz loop) ;; NIL out the last cons. - (storew nil-value dst 1 list-pointer-lowtag)) + (storew nil-value dst 1 list-pointer-lowtag) + (inst cld)) (emit-label done)))) ;;; Return the location and size of the &MORE arg glob created by Index: nlx.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/compiler/x86/nlx.lisp,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- nlx.lisp 5 Jun 2007 11:42:54 -0000 1.23 +++ nlx.lisp 5 Mar 2008 15:11:19 -0000 1.24 @@ -237,7 +237,7 @@ (inst std) (inst rep) (inst movs :dword) - + (inst cld) DONE ;; Reset the CSP at last moved arg. (inst lea esp-tn (make-ea :dword :base edi :disp n-word-bytes)))) Index: values.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/compiler/x86/values.lisp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- values.lisp 6 May 2007 17:56:28 -0000 1.11 +++ values.lisp 5 Mar 2008 15:11:19 -0000 1.12 @@ -38,6 +38,7 @@ (inst movs :dword) (inst cmp esp-tn esi) (inst jmp :be loop) + (inst cld) DONE (inst lea esp-tn (make-ea :dword :base edi :disp n-word-bytes)) (inst sub edi esi) |