Bootstrap on powerpc-apple-darwin9 at revision 154872 is broken: ... libtool: compile: /opt/gcc/darwin_buildw/./gcc/xgcc -B/opt/gcc/darwin_buildw/./gcc/ -B/opt/gcc/gcc4.5w/powerpc-apple-darwin9/bin/ -B/opt/gcc/gcc4.5w/powerpc-apple-darwin9/lib/ -isystem /opt/gcc/gcc4.5w/powerpc-apple-darwin9/include -isystem /opt/gcc/gcc4.5w/powerpc-apple-darwin9/sys-include -m64 -DHAVE_CONFIG_H -I. -I../../../../gcc-4.5-work/libffi -I. -I../../../../gcc-4.5-work/libffi/include -Iinclude -I../../../../gcc-4.5-work/libffi/src -Wall -g -fexceptions -g -O2 -m64 -MT src/powerpc/ffi_darwin.lo -MD -MP -MF src/powerpc/.deps/ffi_darwin.Tpo -c ../../../../gcc-4.5-work/libffi/src/powerpc/ffi_darwin.c -fno-common -DPIC -o src/powerpc/.libs/ffi_darwin.o ../../../../gcc-4.5-work/libffi/src/powerpc/ffi_darwin.c: In function 'ffi_prep_args': ../../../../gcc-4.5-work/libffi/src/powerpc/ffi_darwin.c:160:6: error: lvalue required as increment operand ../../../../gcc-4.5-work/libffi/src/powerpc/ffi_darwin.c: In function 'ffi_call': ../../../../gcc-4.5-work/libffi/src/powerpc/ffi_darwin.c:499:6: warning: passing argument 6 of 'ffi_call_AIX' from incompatible pointer type ../../../../gcc-4.5-work/libffi/src/powerpc/ffi_darwin.c:472:13: note: expected 'void (*)(void)' but argument is of type 'void (*)(struct extended_cif *, long unsigned int * const)' ../../../../gcc-4.5-work/libffi/src/powerpc/ffi_darwin.c:503:9: warning: passing argument 6 of 'ffi_call_DARWIN' from incompatible pointer type ../../../../gcc-4.5-work/libffi/src/powerpc/ffi_darwin.c:474:13: note: expected 'void (*)(void)' but argument is of type 'void (*)(struct extended_cif *, long unsigned int * const)' ... Likely due to revision 154855: Subject: Bug 35484 Author: dje Date: Mon Nov 30 23:34:33 2009 New Revision: 154855 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154855 Log: 2009-11-30 David Edelsohn <edelsohn@gnu.org> PR target/35484 * src/powerpc/ffitarget.h (POWERPC64): Define for PPC64 Linux and AIX64. * src/powerpc/aix.S: Implement AIX64 version. * src/powerpc/aix_closure.S: Implement AIX64 version. (ffi_closure_ASM): Use extsb, lha and displament addresses. * src/powerpc/ffi_darwin.c (ffi_prep_args): Implement AIX64 support. (ffi_prep_cif_machdep): Same. (ffi_call): Same. (ffi_closure_helper_DARWIN): Same. Modified: trunk/libffi/ChangeLog trunk/libffi/src/powerpc/aix.S trunk/libffi/src/powerpc/aix_closure.S trunk/libffi/src/powerpc/ffi_darwin.c trunk/libffi/src/powerpc/ffitarget.h See also http://gcc.gnu.org/ml/gcc-regression/2009-12/msg00004.html .
I have no idea if this the right fix, but the following patch allows bootstrap to proceed: --- ../_gcc_clean/libffi/src/powerpc/ffi_darwin.c 2009-12-01 13:16:43.000000000 +0100 +++ ../gcc-4.5-work/libffi/src/powerpc/ffi_darwin.c 2009-12-01 20:51:19.000000000 +0100 @@ -157,7 +157,7 @@ void ffi_prep_args(extended_cif *ecif, u case FFI_TYPE_LONGDOUBLE: #ifdef POWERPC64 if (fparg_count < NUM_FPR_ARG_REGISTERS) - *((long double *) fpr_base)++ = *(long double *) *p_argv; + *(long double *) fpr_base++ = *(long double *) *p_argv; else *(long double *) next_arg = *(long double *) *p_argv; next_arg += 2;
With the patch in comment #1, the test results are: Running target unix Using /sw/share/dejagnu/baseboards/unix.exp as board description file for target. Using /sw/share/dejagnu/config/unix.exp as generic interface file for target. Using /opt/gcc/gcc-4.5-work/libffi/testsuite/config/default.exp as tool-and-target-specific interface file. Running /opt/gcc/gcc-4.5-work/libffi/testsuite/libffi.call/call.exp ... FAIL: libffi.call/cls_double_va.c -O0 -W -Wall output pattern test, is -0.0 FAIL: libffi.call/cls_longdouble.c -O0 -W -Wall execution test FAIL: libffi.call/cls_longdouble_va.c -O0 -W -Wall output pattern test, is -0.0 FAIL: libffi.call/float.c -O0 -W -Wall execution test FAIL: libffi.call/float4.c -O0 -W -Wall execution test FAIL: libffi.call/many.c -O0 -W -Wall execution test FAIL: libffi.call/nested_struct5.c -O0 -W -Wall execution test FAIL: libffi.call/return_dbl.c -O0 -W -Wall execution test FAIL: libffi.call/return_dbl1.c -O0 -W -Wall execution test FAIL: libffi.call/return_dbl2.c -O0 -W -Wall execution test FAIL: libffi.call/return_fl.c -O0 -W -Wall execution test FAIL: libffi.call/return_fl1.c -O0 -W -Wall execution test FAIL: libffi.call/return_fl2.c -O0 -W -Wall execution test FAIL: libffi.call/return_fl3.c -O0 -W -Wall execution test FAIL: libffi.call/return_ldl.c -O0 -W -Wall execution test FAIL: libffi.call/cls_double_va.c -O2 output pattern test, is -0.0 FAIL: libffi.call/cls_longdouble.c -O2 execution test FAIL: libffi.call/cls_longdouble_va.c -O2 output pattern test, is -0.0 FAIL: libffi.call/float.c -O2 execution test FAIL: libffi.call/float4.c -O2 execution test FAIL: libffi.call/many.c -O2 execution test FAIL: libffi.call/return_dbl.c -O2 execution test FAIL: libffi.call/return_dbl1.c -O2 execution test FAIL: libffi.call/return_dbl2.c -O2 execution test FAIL: libffi.call/return_fl.c -O2 execution test FAIL: libffi.call/return_fl1.c -O2 execution test FAIL: libffi.call/return_fl2.c -O2 execution test FAIL: libffi.call/return_fl3.c -O2 execution test FAIL: libffi.call/return_ldl.c -O2 execution test FAIL: libffi.call/cls_double_va.c -O3 output pattern test, is -0.0 FAIL: libffi.call/cls_longdouble.c -O3 execution test FAIL: libffi.call/cls_longdouble_va.c -O3 output pattern test, is -0.0 FAIL: libffi.call/float.c -O3 execution test FAIL: libffi.call/float4.c -O3 execution test FAIL: libffi.call/many.c -O3 execution test FAIL: libffi.call/return_dbl.c -O3 execution test FAIL: libffi.call/return_dbl1.c -O3 execution test FAIL: libffi.call/return_dbl2.c -O3 execution test FAIL: libffi.call/return_fl.c -O3 execution test FAIL: libffi.call/return_fl1.c -O3 execution test FAIL: libffi.call/return_fl2.c -O3 execution test FAIL: libffi.call/return_fl3.c -O3 execution test FAIL: libffi.call/return_ldl.c -O3 execution test FAIL: libffi.call/cls_double_va.c -Os output pattern test, is -0.0 FAIL: libffi.call/cls_longdouble.c -Os execution test FAIL: libffi.call/cls_longdouble_va.c -Os output pattern test, is -0.0 FAIL: libffi.call/float.c -Os execution test FAIL: libffi.call/float4.c -Os execution test FAIL: libffi.call/many.c -Os execution test FAIL: libffi.call/return_dbl.c -Os execution test FAIL: libffi.call/return_dbl1.c -Os execution test FAIL: libffi.call/return_dbl2.c -Os execution test FAIL: libffi.call/return_fl.c -Os execution test FAIL: libffi.call/return_fl1.c -Os execution test FAIL: libffi.call/return_fl2.c -Os execution test FAIL: libffi.call/return_fl3.c -Os execution test FAIL: libffi.call/return_ldl.c -Os execution test FAIL: libffi.call/cls_double_va.c -O2 -fomit-frame-pointer output pattern test, is -0.0 FAIL: libffi.call/cls_longdouble.c -O2 -fomit-frame-pointer execution test FAIL: libffi.call/cls_longdouble_va.c -O2 -fomit-frame-pointer output pattern test, is -0.0 FAIL: libffi.call/float.c -O2 -fomit-frame-pointer execution test FAIL: libffi.call/float4.c -O2 -fomit-frame-pointer execution test FAIL: libffi.call/many.c -O2 -fomit-frame-pointer execution test FAIL: libffi.call/return_dbl.c -O2 -fomit-frame-pointer execution test FAIL: libffi.call/return_dbl1.c -O2 -fomit-frame-pointer execution test FAIL: libffi.call/return_dbl2.c -O2 -fomit-frame-pointer execution test FAIL: libffi.call/return_fl.c -O2 -fomit-frame-pointer execution test FAIL: libffi.call/return_fl1.c -O2 -fomit-frame-pointer execution test FAIL: libffi.call/return_fl2.c -O2 -fomit-frame-pointer execution test FAIL: libffi.call/return_fl3.c -O2 -fomit-frame-pointer execution test FAIL: libffi.call/return_ldl.c -O2 -fomit-frame-pointer execution test Running /opt/gcc/gcc-4.5-work/libffi/testsuite/libffi.special/special.exp ... === libffi Summary for unix === # of expected passes 1532 # of unexpected failures 71 # of expected failures 10 # of unsupported tests 15 Running target unix/-m64 Using /sw/share/dejagnu/baseboards/unix.exp as board description file for target. Using /sw/share/dejagnu/config/unix.exp as generic interface file for target. Using /opt/gcc/gcc-4.5-work/libffi/testsuite/config/default.exp as tool-and-target-specific interface file. Running /opt/gcc/gcc-4.5-work/libffi/testsuite/libffi.call/call.exp ... FAIL: libffi.call/closure_fn0.c -O0 -W -Wall execution test FAIL: libffi.call/closure_fn1.c -O0 -W -Wall execution test ... FAIL: libffi.special/unwindtest_ffi_call.cc -shared-libgcc -lstdc++ execution test === libffi Summary for unix/-m64 === # of expected passes 593 # of unexpected failures 583 # of expected failures 10 # of unsupported tests 15 === libffi Summary === # of expected passes 2125 # of unexpected failures 654 # of expected failures 20 # of unsupported tests 30 Instead of (revision 154736): Running target unix FAIL: libffi.call/cls_double_va.c -O0 -W -Wall output pattern test, is -0.0 FAIL: libffi.call/cls_longdouble_va.c -O0 -W -Wall output pattern test, is -0.0 FAIL: libffi.call/nested_struct5.c -O0 -W -Wall execution test FAIL: libffi.call/cls_double_va.c -O2 output pattern test, is -0.0 FAIL: libffi.call/cls_longdouble_va.c -O2 output pattern test, is -0.0 FAIL: libffi.call/cls_double_va.c -O3 output pattern test, is -0.0 FAIL: libffi.call/cls_longdouble_va.c -O3 output pattern test, is -0.0 FAIL: libffi.call/cls_double_va.c -Os output pattern test, is -0.0 FAIL: libffi.call/cls_longdouble_va.c -Os output pattern test, is -0.0 FAIL: libffi.call/cls_double_va.c -O2 -fomit-frame-pointer output pattern test, is -0.0 FAIL: libffi.call/cls_longdouble_va.c -O2 -fomit-frame-pointer output pattern test, is -0.0 === libffi Summary for unix === # of expected passes 1597 # of unexpected failures 11 # of expected failures 10 # of unsupported tests 15 Running target unix/-m64 FAIL: libffi.call/closure_fn0.c -O0 -W -Wall execution test FAIL: libffi.call/closure_fn1.c -O0 -W -Wall execution test ... === libffi Summary for unix/-m64 === # of expected passes 593 # of unexpected failures 583 # of expected failures 10 # of unsupported tests 15 === libffi Summary === # of expected passes 2190 # of unexpected failures 594 # of expected failures 20 # of unsupported tests 30
Yes
I believe the bootstrap failure should be fixed. Please let me know about the testsuite results.
See http://gcc.gnu.org/ml/gcc-testresults/2009-12/msg00147.html for results at revision 154892.
Darwin and AIX share most of the C code and the assembly files are nearly identical for 32 bit support, except for the format of calls. The results on AIX now are clean. I cannot see any reason for the difference between the AIX results and the Apple regression tester results. The regression tester results look identical to the results you posted with your long double fix and without my additional patches.
See also pr35484.
Bootstrap is fixed.
Bootstrap is fixed, but mysterious libffi failures remain.
The only unique change was in ffitarget.h: #elif defined (POWERPC_DARWIN) && defined (__ppc64__) /* Darwin */ #define POWERPC64 Does Darwin define __ppc64__ in 32 bit mode on 64 bit systems?
> Does Darwin define __ppc64__ in 32 bit mode on 64 bit systems? I cannot answer the question, but I see gcc/config/rs6000/darwin.h: if (TARGET_64BIT) builtin_define ("__ppc64__"); \ Assuming powerpc-apple-darwin9 is a 32 bit target, __ppc64__ should not be defined (?).
On powerpc-apple-darwin9 using a dual G5, for Apple's gcc 4.0 and 4.2 compilers as well as FSF gcc 4.4.2's, one gets... howarth% gcc -m32 -E -dM -x c /dev/null | grep LP64 howarth% only at -m64 do all of the compilers define LP64... howarth% gcc -m64 -E -dM -x c /dev/null | grep LP64 #define __LP64__ 1 #define _LP64 1
One would assume ... I do not see any differences that should cause the 11 FPR return value tests to fail on Darwin but not AIX.
Same is true for __ppc64__. For the Apple gcc-4.0 and 4.2 compilers as well as FSF gcc-4.4.2, __ppc64__ is only defined at -m64 and not -m32 as would be expected.
One would not expect __ppc64__ to be defined for -m32. Thanks for the confirmation. I do not have access to a darwin system. Do either of you have enough PPC assembly knowledge to step through libffi/testsuite/libffi.call/return_fl1.c in a debugger?
I found a system and backported the libffi changes. For some reason, Darwin is calculating the stack location of FP arguments wrong.
Can you verify that powerpc darwin calculates the stack location of FP arguments correctly before your patch to see if it was a latent problem?
Subject: Bug 42243 Author: dje Date: Thu Dec 3 19:09:29 2009 New Revision: 154956 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154956 Log: PR libffi/42243 * src/powerpc/ffi_darwin.c (ffi_prep_args): Remove extra parentheses. Modified: trunk/libffi/ChangeLog trunk/libffi/src/powerpc/ffi_darwin.c
At revision 154956 the results are: === libffi tests === Running target unix FAIL: libffi.call/cls_double_va.c -O0 -W -Wall output pattern test, is -0.0 FAIL: libffi.call/cls_longdouble.c -O0 -W -Wall execution test FAIL: libffi.call/cls_longdouble_va.c -O0 -W -Wall output pattern test, is -0.0 FAIL: libffi.call/nested_struct5.c -O0 -W -Wall execution test FAIL: libffi.call/cls_double_va.c -O2 output pattern test, is -0.0 FAIL: libffi.call/cls_longdouble.c -O2 execution test FAIL: libffi.call/cls_longdouble_va.c -O2 output pattern test, is -0.0 FAIL: libffi.call/cls_double_va.c -O3 output pattern test, is -0.0 FAIL: libffi.call/cls_longdouble.c -O3 execution test FAIL: libffi.call/cls_longdouble_va.c -O3 output pattern test, is -0.0 FAIL: libffi.call/cls_double_va.c -Os output pattern test, is -0.0 FAIL: libffi.call/cls_longdouble.c -Os execution test FAIL: libffi.call/cls_longdouble_va.c -Os output pattern test, is -0.0 FAIL: libffi.call/cls_double_va.c -O2 -fomit-frame-pointer output pattern test, is -0.0 FAIL: libffi.call/cls_longdouble.c -O2 -fomit-frame-pointer execution test FAIL: libffi.call/cls_longdouble_va.c -O2 -fomit-frame-pointer output pattern test, is -0.0 === libffi Summary === # of expected passes 1587 # of unexpected failures 16 # of expected failures 10 # of unsupported tests 15 So the libffi.call/cls_longdouble.c test is still failing while it was not before revision 154855.
At revision 154970, there are still 16 failures, but the error has changed for libffi.call/cls_longdouble.c: ... FAIL: libffi.call/cls_longdouble.c -O0 -W -Wall output pattern test, is 1 2 3 4 5 6 7 8: 36 ... Looking at the log file, I see: 1 2 3 4 5 6 7 8: 36 res: 36 1 2 3 4 5 6 7 7: 35 res: 35 PASS: libffi.call/cls_longdouble.c -O2 execution test FAIL: libffi.call/cls_longdouble.c -O2 output pattern test, is 1 2 3 4 5 6 7 8: 36 res: 361 2 3 4 5 6 7 7: 35res: 35 , should match 1 2 3 4 5 6 7 8: 36^M? res: 36^M? 1 2 3 4 5 6 7 8: 36^M? res: 36
At revision 154983, I get === libffi tests === Running target unix FAIL: libffi.call/cls_double_va.c -O0 -W -Wall output pattern test, is -0.0 FAIL: libffi.call/cls_longdouble_va.c -O0 -W -Wall output pattern test, is -0.0 FAIL: libffi.call/nested_struct5.c -O0 -W -Wall execution test FAIL: libffi.call/cls_double_va.c -O2 output pattern test, is -0.0 FAIL: libffi.call/cls_longdouble_va.c -O2 output pattern test, is -0.0 FAIL: libffi.call/cls_double_va.c -O3 output pattern test, is -0.0 FAIL: libffi.call/cls_longdouble_va.c -O3 output pattern test, is -0.0 FAIL: libffi.call/cls_double_va.c -Os output pattern test, is -0.0 FAIL: libffi.call/cls_longdouble_va.c -Os output pattern test, is -0.0 FAIL: libffi.call/cls_double_va.c -O2 -fomit-frame-pointer output pattern test, is -0.0 FAIL: libffi.call/cls_longdouble_va.c -O2 -fomit-frame-pointer output pattern test, is -0.0 === libffi Summary === # of expected passes 1597 # of unexpected failures 11 # of expected failures 10 # of unsupported tests 15 So it seems that all the problems due to revision 154855 are now fixed. Thanks for the patches. BTW did you get an idea about where to look for the remaining 11 failures?
Have you tried r154983 with http://gcc.gnu.org/ml/gcc-patches/2009-12/msg00255.html?
> Have you tried r154983 with > http://gcc.gnu.org/ml/gcc-patches/2009-12/msg00255.html? Not yet!
> Have you tried r154983 with > http://gcc.gnu.org/ml/gcc-patches/2009-12/msg00255.html? The patch does not change anything, I get the same failures with or without it.
If there is no objection, I'll close tomorrow this pr as fixed. The failure of libffi.call/nested_struct5.c is pr34311 (Opened: 2007-12-01) and I'll open a new pr for the failures of libffi.call/cls_*double_va.c.
I have open pr42378 for the remaining failures in comment #21 (I did not include libffi.call/nested_struct5.c that is pr34311). Closing this PR as fixed, please reopen if you disagree.