]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libffi/34612 ([4.1/4.2] libffi doesn't work with -fomit-frame-pointer on ia32)
authorH.J. Lu <hongjiu.lu@intel.com>
Wed, 30 Jan 2008 14:36:58 +0000 (14:36 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Wed, 30 Jan 2008 14:36:58 +0000 (06:36 -0800)
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.

From-SVN: r131964

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

index 7026706836c45be8e2b6ddbcf8bd4ef84551ec8b..2dc82af51115f43e8073e1b1aa7c854b5fa7b102 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 f22c939c0a8943180500bfb9ddf8fc258ef3a0c6..a0daf1dca94867544a24c1f412431e2dd0b21fe8 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 bd4d2e8cc2570232191e3118bf283d630bcf319e..25e010999756e47997fb56d4a2dcbac149821a62 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