OSDN Git Service

2008-01-30 H.J. Lu <hongjiu.lu@intel.com>
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Jan 2008 14:36:58 +0000 (14:36 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Jan 2008 14:36:58 +0000 (14:36 +0000)
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

libffi/ChangeLog
libffi/src/x86/sysv.S
libffi/testsuite/libffi.call/call.exp

index 7026706..2dc82af 100644 (file)
@@ -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.
index f22c939..a0daf1d 100644 (file)
@@ -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
 
index bd4d2e8..25e0109 100644 (file)
@@ -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