Fixed #58 zdot SEGFAULT bug with GCC-4.6. Thank Mr. John for this patch.

In i386 calling convention, the caller put the address of return value of zdot into the first hidden parameter.
Thus, the callee should delete this address before return.
Actually, I have fixed the same bug on x86/zdot_sse2.S (issue #32). However, that is not a good implementation which uses 3 instructions. Mr. John told me used "ret $0x4" to skip the first hidden address (4 bytes).
This commit is contained in:
Zhang Xiianyi 2011-09-14 23:52:51 +08:00
parent 260db9fb9e
commit 7b410b7f0e
3 changed files with 19 additions and 5 deletions

View File

@ -307,7 +307,11 @@
popl %ebx popl %ebx
popl %esi popl %esi
popl %edi popl %edi
#if defined(F_INTERFACE) && defined(RETURN_BY_STACK)
ret $0x4
#else
ret ret
#endif
ALIGN_3 ALIGN_3
.L88: .L88:
@ -326,6 +330,10 @@
popl %ebx popl %ebx
popl %esi popl %esi
popl %edi popl %edi
ret
#if defined(F_INTERFACE) && defined(RETURN_BY_STACK)
ret $0x4
#else
ret
#endif
EPILOGUE EPILOGUE

View File

@ -283,7 +283,11 @@
popl %ebx popl %ebx
popl %esi popl %esi
popl %edi popl %edi
#if defined(DOUBLE) || defined(XDOUBLE)
ret $0x4
#else
ret ret
#endif
ALIGN_3 ALIGN_3
.L88: .L88:
@ -305,6 +309,10 @@
popl %ebx popl %ebx
popl %esi popl %esi
popl %edi popl %edi
ret
#if defined(DOUBLE) || defined(XDOUBLE)
ret $0x4
#else
ret
#endif
EPILOGUE EPILOGUE

View File

@ -1542,7 +1542,5 @@
popl %esi popl %esi
popl %edi popl %edi
/*remove the hidden return value address from the stack.*/ /*remove the hidden return value address from the stack.*/
popl %ecx ret $0x4
xchgl %ecx, 0(%esp)
ret
EPILOGUE EPILOGUE