This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: [PATCH, libffi]: Fix PR libffi/41908
- From: Andrew Haley <aph at redhat dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, libffi-discuss at sourceware dot org
- Date: Fri, 04 Dec 2009 10:04:19 +0000
- Subject: Re: [PATCH, libffi]: Fix PR libffi/41908
- References: <4B182715.60501@gmail.com>
Uros Bizjak wrote:
> 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?
Yes, this looks good to me.
Andrew.