This is on a Fedora Core 4 machine: gij (GNU libgcj) version 4.0.1 20050727 (Red Hat 4.0.1-5) The to be attached code does not run properly on ppc. Runs fine on x86 (32 and 64 bit). The byte-code appears to be correct because it runs fine using the IBM JVM. Compiled with: javac plplot/*/*.java Run with: java plplot.examples.x08 The output is the arguments passed to plw3d(). In the source this is: pls.w3d( 1.0, 1.0, 1.0, -1.5, 1.5, -0.5, 1.5, zmin, zmax, alt[k], az[k] ); Output (first loop) is: 0.0 1.0 1.0 -1.5 1.5 -0.5 1.5 -5.093869927024149 NaN -3.7431896459052014E-274 5.32506451E-315 Correct output should be: 1.0 1.0 1.0 -1.5 1.5 -0.5 1.5 -5.093869927024149 6.636602508481567 60.0 30.0 It looks like arg1, arg9, arg10, and arg11 are not passed properly.
Created attachment 9499 [details] Java code to reproduce problem.
I think this is a libffi issue rather than anything else.
I could not reproduce this problem using a powerpc64 gij. However, I could when using a powerpc gij. Retargetting.
Subject: Bug 23404 CVSROOT: /cvs/gcc Module name: gcc Changes by: amodra@gcc.gnu.org 2005-08-25 00:54:54 Modified files: libffi : ChangeLog libffi/src/powerpc: ffi.c Log message: PR target/23404 * src/powerpc/ffi.c (ffi_prep_args_SYSV): Correct placement of stack homed fp args. (ffi_status ffi_prep_cif_machdep): Correct stack sizing for same. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libffi/ChangeLog.diff?cvsroot=gcc&r1=1.248&r2=1.249 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libffi/src/powerpc/ffi.c.diff?cvsroot=gcc&r1=1.14&r2=1.15
Subject: Bug 23404 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: amodra@gcc.gnu.org 2005-08-25 00:56:36 Modified files: libffi : ChangeLog libffi/src/powerpc: ffi.c Log message: PR target/23404 * src/powerpc/ffi.c (ffi_prep_args_SYSV): Correct placement of stack homed fp args. (ffi_status ffi_prep_cif_machdep): Correct stack sizing for same. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libffi/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.222.2.6&r2=1.222.2.7 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libffi/src/powerpc/ffi.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.12&r2=1.12.2.1
Subject: Bug 23404 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: amodra@gcc.gnu.org 2005-08-25 01:09:56 Modified files: libffi : ChangeLog libffi/src/powerpc: ffi.c Log message: PR target/23404 * src/powerpc/ffi.c (ffi_prep_args_SYSV): Correct placement of stack homed fp args. (ffi_status ffi_prep_cif_machdep): Correct stack sizing for same. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libffi/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.153.4.14&r2=1.153.4.15 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libffi/src/powerpc/ffi.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.7.10.1&r2=1.7.10.2
Fixed.