* [Bug libffi/56033] FAIL: libffi.call/cls_struct_va1.c on powerpc-apple-darwin9 with -m64
2013-01-18 14:25 [Bug libffi/56033] New: FAIL: libffi.call/cls_struct_va1.c on powerpc-apple-darwin9 with -m64 dominiq at lps dot ens.fr
@ 2013-01-22 12:17 ` ro at gcc dot gnu.org
2013-02-02 17:23 ` dominiq at lps dot ens.fr
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: ro at gcc dot gnu.org @ 2013-01-22 12:17 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56033
Rainer Orth <ro at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target|powerpc-apple-darwin9 |powerpc-apple-darwin9,
| |sparc-sun-solaris2*
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-01-22
CC| |ebotcazou at gcc dot
| |gnu.org, green at gcc dot
| |gnu.org, ro at gcc dot
| |gnu.org
Host|powerpc-apple-darwin9 |powerpc-apple-darwin9,
| |sparc-sun-solaris2*
Target Milestone|--- |4.8.0
Ever Confirmed|0 |1
Build|powerpc-apple-darwin9 |powerpc-apple-darwin9,
| |sparc-sun-solaris2*
--- Comment #1 from Rainer Orth <ro at gcc dot gnu.org> 2013-01-22 12:16:52 UTC ---
I'm seeing the same failures on 64-bit Solaris/SPARC, also with upstream libffi
and e.g. gcc 4.4 instead of mainline.
Rainer
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug libffi/56033] FAIL: libffi.call/cls_struct_va1.c on powerpc-apple-darwin9 with -m64
2013-01-18 14:25 [Bug libffi/56033] New: FAIL: libffi.call/cls_struct_va1.c on powerpc-apple-darwin9 with -m64 dominiq at lps dot ens.fr
2013-01-22 12:17 ` [Bug libffi/56033] " ro at gcc dot gnu.org
@ 2013-02-02 17:23 ` dominiq at lps dot ens.fr
2013-02-02 17:25 ` [Bug libffi/56033] FAIL: libffi.call/cls_struct_va1.c on powerpc-*-* and sparc-sun-solaris2* " dominiq at lps dot ens.fr
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-02-02 17:23 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56033
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target|powerpc-apple-darwin9, |powerpc*-*-*,
|sparc-sun-solaris2* |sparc-sun-solaris2*
Host|powerpc-apple-darwin9, |powerpc*-*-*,
|sparc-sun-solaris2* |sparc-sun-solaris2*
Build|powerpc-apple-darwin9, |powerpc*-*-*,
|sparc-sun-solaris2* |sparc-sun-solaris2*
--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2013-02-02 17:22:32 UTC ---
Also seen on powerpc64-unknown-linux-gnu:
http://gcc.gnu.org/ml/gcc-testresults/2013-02/msg00089.html
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug libffi/56033] FAIL: libffi.call/cls_struct_va1.c on powerpc-*-* and sparc-sun-solaris2* with -m64
2013-01-18 14:25 [Bug libffi/56033] New: FAIL: libffi.call/cls_struct_va1.c on powerpc-apple-darwin9 with -m64 dominiq at lps dot ens.fr
2013-01-22 12:17 ` [Bug libffi/56033] " ro at gcc dot gnu.org
2013-02-02 17:23 ` dominiq at lps dot ens.fr
@ 2013-02-02 17:25 ` dominiq at lps dot ens.fr
2013-03-22 14:43 ` jakub at gcc dot gnu.org
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-02-02 17:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56033
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|FAIL: |FAIL:
|libffi.call/cls_struct_va1. |libffi.call/cls_struct_va1.
|c on powerpc-apple-darwin9 |c on powerpc-*-* and
|with -m64 |sparc-sun-solaris2* with
| |-m64
--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2013-02-02 17:25:07 UTC ---
Changed the summary to better reflect the affected platforms.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug libffi/56033] FAIL: libffi.call/cls_struct_va1.c on powerpc-*-* and sparc-sun-solaris2* with -m64
2013-01-18 14:25 [Bug libffi/56033] New: FAIL: libffi.call/cls_struct_va1.c on powerpc-apple-darwin9 with -m64 dominiq at lps dot ens.fr
` (2 preceding siblings ...)
2013-02-02 17:25 ` [Bug libffi/56033] FAIL: libffi.call/cls_struct_va1.c on powerpc-*-* and sparc-sun-solaris2* " dominiq at lps dot ens.fr
@ 2013-03-22 14:43 ` jakub at gcc dot gnu.org
2013-04-08 11:19 ` krebbel at gcc dot gnu.org
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-03-22 14:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56033
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.8.0 |4.8.1
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-03-22 14:43:04 UTC ---
GCC 4.8.0 is being released, adjusting target milestone.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug libffi/56033] FAIL: libffi.call/cls_struct_va1.c on powerpc-*-* and sparc-sun-solaris2* with -m64
2013-01-18 14:25 [Bug libffi/56033] New: FAIL: libffi.call/cls_struct_va1.c on powerpc-apple-darwin9 with -m64 dominiq at lps dot ens.fr
` (3 preceding siblings ...)
2013-03-22 14:43 ` jakub at gcc dot gnu.org
@ 2013-04-08 11:19 ` krebbel at gcc dot gnu.org
2013-04-08 11:24 ` krebbel at gcc dot gnu.org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: krebbel at gcc dot gnu.org @ 2013-04-08 11:19 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56033
Andreas Krebbel <krebbel at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |krebbel at gcc dot gnu.org
--- Comment #5 from Andreas Krebbel <krebbel at gcc dot gnu.org> 2013-04-08 11:19:16 UTC ---
Confirmed for s390x.
Looks like an endianess issue to me. In cls_struct_va1.c the void pointer to
the return value is cast to an int pointer before writing to it:
static void
test_fn (ffi_cif* cif __UNUSED__, void* resp,
void** args, void* userdata __UNUSED__)
{
...
* (int*) resp = 42;
}
But the pointer later on is expected to point to a register size value.
There are also testcases which do it differently (e.g. closure_fn0.c). They
cast the pointer to the return value to ffi_arg* before accessing it. ffi_arg
is defined to be a register size type. From the documentation I cannot tell
which one is supposed to be correct.
static void
closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args,
void* userdata)
{
*(ffi_arg*)resp = ...
}
Btw. for both examples the return type is defined as &ffi_type_sint in
ffi_prep_cif
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug libffi/56033] FAIL: libffi.call/cls_struct_va1.c on powerpc-*-* and sparc-sun-solaris2* with -m64
2013-01-18 14:25 [Bug libffi/56033] New: FAIL: libffi.call/cls_struct_va1.c on powerpc-apple-darwin9 with -m64 dominiq at lps dot ens.fr
` (4 preceding siblings ...)
2013-04-08 11:19 ` krebbel at gcc dot gnu.org
@ 2013-04-08 11:24 ` krebbel at gcc dot gnu.org
2013-04-22 14:22 ` dominiq at lps dot ens.fr
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: krebbel at gcc dot gnu.org @ 2013-04-08 11:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56033
--- Comment #6 from Andreas Krebbel <krebbel at gcc dot gnu.org> 2013-04-08 11:24:22 UTC ---
Just noticed the example in libffi documentation which suggests that casting to
the return type pointer should work:
/* Acts like puts with the file given at time of enclosure. */
void puts_binding(ffi_cif *cif, unsigned int *ret, void* args[],
FILE *stream)
@{
*ret = fputs(*(char **)args[0], stream);
@}
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug libffi/56033] FAIL: libffi.call/cls_struct_va1.c on powerpc-*-* and sparc-sun-solaris2* with -m64
2013-01-18 14:25 [Bug libffi/56033] New: FAIL: libffi.call/cls_struct_va1.c on powerpc-apple-darwin9 with -m64 dominiq at lps dot ens.fr
` (5 preceding siblings ...)
2013-04-08 11:24 ` krebbel at gcc dot gnu.org
@ 2013-04-22 14:22 ` dominiq at lps dot ens.fr
2013-05-13 11:31 ` ro at CeBiTec dot Uni-Bielefeld.DE
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-04-22 14:22 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56033
--- Comment #7 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2013-04-22 14:22:15 UTC ---
Following the recipe in comment #5, the following patch
diff -up /opt/gcc/_gcc_clean/libffi/testsuite/libffi.call/cls_struct_va1.c
/opt/gcc/work/libffi/testsuite/libffi.call/cls_struct_va1.c
--- /opt/gcc/_gcc_clean/libffi/testsuite/libffi.call/cls_struct_va1.c
2013-01-05 19:58:34.000000000 +0100
+++ /opt/gcc/work/libffi/testsuite/libffi.call/cls_struct_va1.c 2013-04-22
15:16:30.000000000 +0200
@@ -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 -up /opt/gcc/_gcc_clean/libffi/testsuite/libffi.call/va_1.c
/opt/gcc/work/libffi/testsuite/libffi.call/va_1.c
--- /opt/gcc/_gcc_clean/libffi/testsuite/libffi.call/va_1.c 2013-01-17
19:52:24.000000000 +0100
+++ /opt/gcc/work/libffi/testsuite/libffi.call/va_1.c 2013-04-22
15:27:35.000000000 +0200
@@ -94,7 +94,7 @@ main (void)
struct large_tag l1;
int n;
- int res;
+ ffi_arg res;
unsigned char uc;
signed char sc;
diff -up /opt/gcc/_gcc_clean/libffi/testsuite/libffi.call/va_struct1.c
/opt/gcc/work/libffi/testsuite/libffi.call/va_struct1.c
--- /opt/gcc/_gcc_clean/libffi/testsuite/libffi.call/va_struct1.c 2013-01-05
19:58:34.000000000 +0100
+++ /opt/gcc/work/libffi/testsuite/libffi.call/va_struct1.c 2013-04-22
15:26:27.000000000 +0200
@@ -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;
fixes the corresponding failures. Note that I did not find how to apply the
recipe to libffi.call/cls_uint_va.c.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug libffi/56033] FAIL: libffi.call/cls_struct_va1.c on powerpc-*-* and sparc-sun-solaris2* with -m64
2013-01-18 14:25 [Bug libffi/56033] New: FAIL: libffi.call/cls_struct_va1.c on powerpc-apple-darwin9 with -m64 dominiq at lps dot ens.fr
` (6 preceding siblings ...)
2013-04-22 14:22 ` dominiq at lps dot ens.fr
@ 2013-05-13 11:31 ` ro at CeBiTec dot Uni-Bielefeld.DE
2013-05-15 13:29 ` dominiq at lps dot ens.fr
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2013-05-13 11:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56033
--- Comment #8 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #7 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2013-04-22 14:22:15 UTC ---
> Following the recipe in comment #5, the following patch
[...]
> fixes the corresponding failures. Note that I did not find how to apply the
> recipe to libffi.call/cls_uint_va.c.
Same for 64-bit sparc-sun-solaris2.*. The following snippet fixes the
cls_unit_va.c failure for me:
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, ...);
I've included the complete patch in i386-pc-solaris2.* bootstraps, too,
and saw no regressions, so I suggest you post the complete patch to
gcc-patches, and Cc: Anthony Green.
Thanks.
Rainer
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug libffi/56033] FAIL: libffi.call/cls_struct_va1.c on powerpc-*-* and sparc-sun-solaris2* with -m64
2013-01-18 14:25 [Bug libffi/56033] New: FAIL: libffi.call/cls_struct_va1.c on powerpc-apple-darwin9 with -m64 dominiq at lps dot ens.fr
` (7 preceding siblings ...)
2013-05-13 11:31 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2013-05-15 13:29 ` dominiq at lps dot ens.fr
2013-05-15 13:32 ` ro at CeBiTec dot Uni-Bielefeld.DE
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-05-15 13:29 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56033
--- Comment #9 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> The following snippet fixes the
> cls_unit_va.c failure for me: ...
Confirmed on powerpc-apple-darwin9. Thanks for the fix.
> I've included the complete patch in i386-pc-solaris2.* bootstraps, too,
> and saw no regressions, so I suggest you post the complete patch to
> gcc-patches, and Cc: Anthony Green.
\begin{rant}
I won't have the time to go through the gcc-patches hooplas before at least one
month (in top of that I don't have write access). If someone really wants these
fixes to be committed to 4.8.1, (s)he will have to do the work.
After all powerpc64-unknown-linux-gnu is supposed to be a primary platform with
several maintainers, not powerpc-apple-darwin9.
\end{rant}
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug libffi/56033] FAIL: libffi.call/cls_struct_va1.c on powerpc-*-* and sparc-sun-solaris2* with -m64
2013-01-18 14:25 [Bug libffi/56033] New: FAIL: libffi.call/cls_struct_va1.c on powerpc-apple-darwin9 with -m64 dominiq at lps dot ens.fr
` (8 preceding siblings ...)
2013-05-15 13:29 ` dominiq at lps dot ens.fr
@ 2013-05-15 13:32 ` ro at CeBiTec dot Uni-Bielefeld.DE
2013-05-15 14:20 ` ro at gcc dot gnu.org
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2013-05-15 13:32 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56033
--- Comment #10 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #9 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
[...]
>> I've included the complete patch in i386-pc-solaris2.* bootstraps, too,
>> and saw no regressions, so I suggest you post the complete patch to
>> gcc-patches, and Cc: Anthony Green.
>
> \begin{rant}
>
> I won't have the time to go through the gcc-patches hooplas before at least one
> month (in top of that I don't have write access). If someone really wants these
> fixes to be committed to 4.8.1, (s)he will have to do the work.
I don't know if we can get the patch into 4.8 at this point, but I
certainly want it for mainline. I just suggested that you post it since
it's almost completely your work, but am fine with doing it myself.
Rainer
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug libffi/56033] FAIL: libffi.call/cls_struct_va1.c on powerpc-*-* and sparc-sun-solaris2* with -m64
2013-01-18 14:25 [Bug libffi/56033] New: FAIL: libffi.call/cls_struct_va1.c on powerpc-apple-darwin9 with -m64 dominiq at lps dot ens.fr
` (9 preceding siblings ...)
2013-05-15 13:32 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2013-05-15 14:20 ` ro at gcc dot gnu.org
2013-05-15 15:27 ` dominiq at lps dot ens.fr
2013-05-22 12:46 ` ro at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: ro at gcc dot gnu.org @ 2013-05-15 14:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56033
Rainer Orth <ro at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
URL| |http://gcc.gnu.org/ml/gcc-p
| |atches/2013-05/msg00840.htm
| |l
--- Comment #11 from Rainer Orth <ro at gcc dot gnu.org> ---
Patch submitted.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug libffi/56033] FAIL: libffi.call/cls_struct_va1.c on powerpc-*-* and sparc-sun-solaris2* with -m64
2013-01-18 14:25 [Bug libffi/56033] New: FAIL: libffi.call/cls_struct_va1.c on powerpc-apple-darwin9 with -m64 dominiq at lps dot ens.fr
` (10 preceding siblings ...)
2013-05-15 14:20 ` ro at gcc dot gnu.org
@ 2013-05-15 15:27 ` dominiq at lps dot ens.fr
2013-05-22 12:46 ` ro at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-05-15 15:27 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56033
--- Comment #12 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> I just suggested that you post it since
> it's almost completely your work, but am fine with doing it myself.
Well, my work has been only to test the recipe in comment #5 for the trivial
cases. The real work has been done by Andreas Krebbel and you.
> Patch submitted.
Thanks.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug libffi/56033] FAIL: libffi.call/cls_struct_va1.c on powerpc-*-* and sparc-sun-solaris2* with -m64
2013-01-18 14:25 [Bug libffi/56033] New: FAIL: libffi.call/cls_struct_va1.c on powerpc-apple-darwin9 with -m64 dominiq at lps dot ens.fr
` (11 preceding siblings ...)
2013-05-15 15:27 ` dominiq at lps dot ens.fr
@ 2013-05-22 12:46 ` ro at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: ro at gcc dot gnu.org @ 2013-05-22 12:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56033
Rainer Orth <ro at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #13 from Rainer Orth <ro at gcc dot gnu.org> ---
Fixed for 4.8.1, 4.9.0.
Rainer
^ permalink raw reply [flat|nested] 14+ messages in thread