Java is severely broken on sparc64-linux with gcc 4.5/4.6, which is a major regression from 4.4:
http://gcc.gnu.org/ml/gcc-testresults/2010-05/msg00853.html (4.6 broken) http://gcc.gnu.org/ml/gcc-testresults/2010-05/msg00681.html (4.5 broken) http://gcc.gnu.org/ml/gcc-testresults/2010-05/msg00472.html (4.4 works) The detailed test suite logs show that _every_ -findirect-dispatch test case SEGFAULTs shortly after startup. I've bisected trunk and identified r155622 as the cause: Author: jakub Date: Mon Jan 4 16:02:41 2010 New Revision: 155622 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155622 Log: PR driver/42442 * gcc.c (SWITCH_IGNORE_PERMANENTLY): Define. (do_self_spec): For switches with SWITCH_IGNORE set set also SWITCH_IGNORE_PERMANENTLY. (check_live_switch): Check SWITCH_IGNORE_PERMANENTLY instead of SWITCH_IGNORE. Let's compare installations of r155621 and r155622: > LD_LIBRARY_PATH=/mnt/scratch/install-r155621/lib: > /mnt/scratch/install-r155621/bin/gcj -v -findirect-dispatch > --main=ArrayStore2 ArrayStore2.jar ... /mnt/scratch/install-r155621/libexec/gcc/sparc64-unknown-linux-gnu/4.5.0/jc1 ArrayStore2.jar -fuse-divide-subroutine -fuse-boehm-gc -fnon-call-exceptions -fPIC -fkeep-inline-functions -quiet -dumpbase ArrayStore2.jar -mcpu=v8 -auxbase ArrayStore2 -g1 -version -findirect-dispatch -fbootclasspath=./:/mnt/scratch/install-r155621/share/java/libgcj-4.5.0.jar -o /tmp/ccCkBmCp.s ... as -V -Qy -s -K PIC -32 -relax -o /tmp/ccgzZvpI.o /tmp/ccCkBmCp.s ... /mnt/scratch/install-r155621/libexec/gcc/sparc64-unknown-linux-gnu/4.5.0/jvgenmain -findirect-dispatch ArrayStore2main /tmp/ccwLkVQ4.i ... /mnt/scratch/install-r155621/libexec/gcc/sparc64-unknown-linux-gnu/4.5.0/cc1 /tmp/ccwLkVQ4.i -quiet -dumpbase ArrayStore2main.c -mcpu=v8 -g1 -version -fdollars-in-identifiers -o /tmp/ccCkBmCp.s ... as -V -Qy -s -32 -relax -o /tmp/cc8Sx4xt.o /tmp/ccCkBmCp.s ... > LD_LIBRARY_PATH=/mnt/scratch/install-r155621/lib: ./a.out index rhs java.lang.ArrayIndexOutOfBoundsException > LD_LIBRARY_PATH=/mnt/scratch/install-r155622/lib: > /mnt/scratch/install-r155622/bin/gcj -v -findirect-dispatch > --main=ArrayStore2 ArrayStore2.jar ... /mnt/scratch/install-r155622/libexec/gcc/sparc64-unknown-linux-gnu/4.5.0/jc1 ArrayStore2.jar -fuse-divide-subroutine -fuse-boehm-gc -fnon-call-exceptions -fPIC -fkeep-inline-functions -quiet -dumpbase ArrayStore2.jar -mcpu=v8 -auxbase ArrayStore2 -g1 -version -findirect-dispatch -fbootclasspath=./:/mnt/scratch/install-r155622/share/java/libgcj-4.5.0.jar -o /tmp/cc5XY9sD.s ... as -V -Qy -s -K PIC -32 -relax -o /tmp/cc626Pob.o /tmp/cc5XY9sD.s ... /mnt/scratch/install-r155622/libexec/gcc/sparc64-unknown-linux-gnu/4.5.0/jvgenmain -findirect-dispatch ArrayStore2main /tmp/ccLsDapM.i ... /mnt/scratch/install-r155622/libexec/gcc/sparc64-unknown-linux-gnu/4.5.0/cc1 /tmp/ccLsDapM.i -quiet -dumpbase ArrayStore2main.c -mcpu=v8 -g1 -version -fdollars-in-identifiers -o /tmp/cc5XY9sD.s ... as -V -Qy -s -K PIC -32 -relax -o /tmp/ccw9Ke7n.o /tmp/cc5XY9sD.s ... > LD_LIBRARY_PATH=/mnt/scratch/install-r155622/lib:. ./a.out Segmentation fault The main difference is that in the working compiler, the java classes are assembled with -K PIC but the generated main() is not, while in the broken compiler both the java classes and the generated main() are assembled with -K PIC. If I force -K PIC with the working compiler it too fails: > LD_LIBRARY_PATH=/mnt/scratch/install-r155621/lib: > /mnt/scratch/install-r155621/bin/gcj -findirect-dispatch --main=ArrayStore2 > -Wa,-K,PIC ArrayStore2.jar > LD_LIBRARY_PATH=/mnt/scratch/install-r155621/lib: ./a.out Segmentation fault I note that gcc/java/jvspec.c has %<findirect-dispatch, and that PR42442 is about correcting the handling of %<match=native. Clearly something here doesn't mix well. -- Summary: [4.5/4.6 regression] massive java failures due to - findirect-dispatch breakage on sparc64-linux Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: java AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mikpe at it dot uu dot se GCC build triplet: sparc64-unknown-linux-gnu GCC host triplet: sparc64-unknown-linux-gnu GCC target triplet: sparc64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44095