From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: gcc-patches@gcc.gnu.org
Cc: java-patches@gcc.gnu.org, Anthony Green <green@redhat.com>,
"Dominique d'Humieres" <dominiq@lps.ens.fr>
Subject: [libffi] Fix several libffi testsuite failures on 64-bit SPARC and PowerPC (PR libffi/56033)
Date: Wed, 15 May 2013 14:19:00 -0000 [thread overview]
Message-ID: <yddwqr0z5of.fsf@lokon.CeBiTec.Uni-Bielefeld.DE> (raw)
[-- Attachment #1: Type: text/plain, Size: 895 bytes --]
As reported in the PR, the recent libffi import into the gcc tree caused
a couple of testsuite failures on 64-bit big-endian targets (like SPARC
or PowerPC).
The following patch (mostly by Dominique) fixes them and finally gets us
clean libffi testsuite results.
Tested on sparc-sun-solaris2.11 on mainline and 4.8 branch and
x86_64-unknown-linux-gnu on mainline by myself and powerpc-apple-darwin9
by Dominique.
Ok for mainline and 4.8 branch where those failures represent
regressions from 4.7?
Rainer
2013-05-15 Dominique d'Humieres <dominiq@lps.ens.fr>
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR libffi/56033
* testsuite/libffi.call/cls_struct_va1.c (test_fn): Cast resp to
ffi_arg *.
* testsuite/libffi.call/cls_uint_va.c (cls_ret_T_fn): Likewise.
* testsuite/libffi.call/va_1.c (main): Change res to ffi_arg.
* testsuite/libffi.call/va_struct1.c (main): Likewise.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: pr56033.patch --]
[-- Type: text/x-patch, Size: 1793 bytes --]
# HG changeset patch
# Parent 04b67cdd4c35eb3ae10f94cfca092b7dd2dc358a
Patch for libffi/56033
diff --git a/libffi/testsuite/libffi.call/cls_struct_va1.c b/libffi/testsuite/libffi.call/cls_struct_va1.c
--- a/libffi/testsuite/libffi.call/cls_struct_va1.c
+++ b/libffi/testsuite/libffi.call/cls_struct_va1.c
@@ -35,7 +35,7 @@ test_fn (ffi_cif* cif __UNUSED__, void*
printf ("%d %d %d %d %d %d %d %d %d %d\n", n, s1.a, s1.b,
l1.a, l1.b, l1.c, l1.d, l1.e,
s2.a, s2.b);
- * (int*) resp = 42;
+ * (ffi_arg*) resp = 42;
}
int
diff --git a/libffi/testsuite/libffi.call/cls_uint_va.c b/libffi/testsuite/libffi.call/cls_uint_va.c
--- a/libffi/testsuite/libffi.call/cls_uint_va.c
+++ b/libffi/testsuite/libffi.call/cls_uint_va.c
@@ -13,9 +13,9 @@ typedef unsigned int T;
static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata __UNUSED__)
{
- *(T *)resp = *(T *)args[0];
+ *(ffi_arg *)resp = *(T *)args[0];
- printf("%d: %d %d\n", *(T *)resp, *(T *)args[0], *(T *)args[1]);
+ printf("%d: %d %d\n", (int)*(ffi_arg *)resp, *(T *)args[0], *(T *)args[1]);
}
typedef T (*cls_ret_T)(T, ...);
diff --git a/libffi/testsuite/libffi.call/va_1.c b/libffi/testsuite/libffi.call/va_1.c
--- a/libffi/testsuite/libffi.call/va_1.c
+++ b/libffi/testsuite/libffi.call/va_1.c
@@ -94,7 +94,7 @@ main (void)
struct large_tag l1;
int n;
- int res;
+ ffi_arg res;
unsigned char uc;
signed char sc;
diff --git a/libffi/testsuite/libffi.call/va_struct1.c b/libffi/testsuite/libffi.call/va_struct1.c
--- a/libffi/testsuite/libffi.call/va_struct1.c
+++ b/libffi/testsuite/libffi.call/va_struct1.c
@@ -61,7 +61,7 @@ main (void)
struct large_tag l1;
int n;
- int res;
+ ffi_arg res;
s_type.size = 0;
s_type.alignment = 0;
[-- Attachment #3: Type: text/plain, Size: 143 bytes --]
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
reply other threads:[~2013-05-15 14:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=yddwqr0z5of.fsf@lokon.CeBiTec.Uni-Bielefeld.DE \
--to=ro@cebitec.uni-bielefeld.de \
--cc=dominiq@lps.ens.fr \
--cc=gcc-patches@gcc.gnu.org \
--cc=green@redhat.com \
--cc=java-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).