summaryrefslogtreecommitdiff
path: root/libffi
diff options
context:
space:
mode:
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2008-01-30 14:36:58 +0000
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2008-01-30 14:36:58 +0000
commit00eae123d66f54631fc21f9567e9ddc898cf1b37 (patch)
treedcd9bca2d5eca6dec19c0986de42932ff8ef664d /libffi
parentd2d2630b24dc8d970183d8e3419d8f804b7b9151 (diff)
downloadgcc-00eae123d66f54631fc21f9567e9ddc898cf1b37.tar.gz
2008-01-30 H.J. Lu <hongjiu.lu@intel.com>
PR libffi/34612 * src/x86/sysv.S (ffi_closure_SYSV): Pop 4 byte from stack when returning struct. * testsuite/libffi.call/call.exp: Add "-O2 -fomit-frame-pointer" tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131964 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libffi')
-rw-r--r--libffi/ChangeLog9
-rw-r--r--libffi/src/x86/sysv.S6
-rw-r--r--libffi/testsuite/libffi.call/call.exp1
3 files changed, 16 insertions, 0 deletions
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index 7026706836c..2dc82af5111 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,12 @@
+2008-01-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR libffi/34612
+ * src/x86/sysv.S (ffi_closure_SYSV): Pop 4 byte from stack when
+ returning struct.
+
+ * testsuite/libffi.call/call.exp: Add "-O2 -fomit-frame-pointer"
+ tests.
+
2008-01-24 David Edelsohn <edelsohn@gnu.org>
* configure: Regenerate.
diff --git a/libffi/src/x86/sysv.S b/libffi/src/x86/sysv.S
index f22c939c0a8..a0daf1dca94 100644
--- a/libffi/src/x86/sysv.S
+++ b/libffi/src/x86/sysv.S
@@ -210,6 +210,8 @@ ffi_closure_SYSV:
je .Lcls_retldouble
cmpl $FFI_TYPE_SINT64, %eax
je .Lcls_retllong
+ cmpl $FFI_TYPE_STRUCT, %eax
+ je .Lcls_retstruct
.Lcls_epilogue:
movl %ebp, %esp
popl %ebp
@@ -230,6 +232,10 @@ ffi_closure_SYSV:
movl (%ecx), %eax
movl 4(%ecx), %edx
jmp .Lcls_epilogue
+.Lcls_retstruct:
+ movl %ebp, %esp
+ popl %ebp
+ ret $4
.LFE2:
.size ffi_closure_SYSV, .-ffi_closure_SYSV
diff --git a/libffi/testsuite/libffi.call/call.exp b/libffi/testsuite/libffi.call/call.exp
index bd4d2e8cc25..25e01099975 100644
--- a/libffi/testsuite/libffi.call/call.exp
+++ b/libffi/testsuite/libffi.call/call.exp
@@ -27,6 +27,7 @@ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O0 -W -Wall" ""
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O2" ""
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O3" ""
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-Os" ""
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O2 -fomit-frame-pointer" ""
dg-finish