This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, libffi]: Fix PR libffi/41908


Hello!

The core of the fix is the fix to this thinko:

-    /* If the struct is larger than 16 bytes, pass it on the stack.  */
-    if (type->size > 16)
+    /* If the struct is larger than 32 bytes, pass it on the stack.  */
+    if (type->size > 32)
       return 0;

Without this part, libffi simply misses special handling for FFI_TYPE_STRUCT with n == 2 in ffi_closure_unix64_inner.

Other than that, I have updated classify_argument function with the copy from gcc/config/i386/i386.c. As can be seen from the patch, the problems were mainly in the merging of SImode and SFmode arguments and some special cases when arguments are passed through memory.


2009-12-03 Uros Bizjak <ubizjak@gmail.com>


    PR libffi/41908
    * src/x86/ffi64.c (classify_argument): Update from
    gcc/config/i386/i386.c.

2009-12-03 Uros Bizjak <ubizjak@gmail.com>

    * testsuite/libffi.call/cls_dbls_struct.c (main): Remove xfail
    for x86_64 linux targets.

Patch was tested on x86_64-pc-linux-gnu, where it fixes all remaining failures.

OK for mainline gcc?

Uros.


Attachment: p.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]