From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7170 invoked by alias); 27 Sep 2004 19:14:49 -0000 Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org Received: (qmail 7122 invoked by uid 48); 27 Sep 2004 19:14:48 -0000 Date: Mon, 27 Sep 2004 19:14:00 -0000 From: "dick at softplc dot com" To: java-prs@gcc.gnu.org Message-ID: <20040927191443.17700.dick@softplc.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug libgcj/17700] New: -Os causes bad build of libgcj.so.5.0.0 file X-Bugzilla-Reason: CC X-SW-Source: 2004-q3/txt/msg00674.txt.bz2 List-Id: On x86 linux 2.6.x using gcc 3.4.2 or 3.4.1 the -Os option causes a bad libgcj.so.5.0.0 image to be built. The symptom of the problem is a NullPointerException in Calendar property file lookup, exhibited by the following program: ---------------------- import java.text.SimpleDateFormat; public class Test { public static void main( String[] args ) { System.out.println("before"); System.out.flush(); SimpleDateFormat dateFormatter = new SimpleDateFormat( "yy-MMM-dd HH:mm" ); System.out.println("after"); System.out.flush(); } } -------------- Running the above program with the bad libgcj.so.5.0.0 gives the "before" output, then the NullPointerException somewhere in the Calendar property file lookup. If you build the libgcj with "-g3 -O2" instead of "-g3 -Os", then all is well. -------------- $ gcj Test.java -o test.prog --main=Test Here is my configure script: -------------- #!/bin/sh # See this URL for instructions on what this all means: # http://gcc.gnu.org/install/ GCJFLAGS="-g3 -O2" # works ok #GCJFLAGS="-g3 -Os" # causes NullPointerException in Test.java #SRCDIR=/rt/gcc-3.4.1 SRCDIR=/rt/gcc-3.4.2 #SRCDIR=/rt/gcc-4.0-20040919 if [ -z $BUILDDIR ]; then BUILDDIR=gccbuild fi if [ ! -e $BUILDDIR ]; then mkdir $BUILDDIR fi PWD=`pwd` cd $BUILDDIR if [ "$1" = "distclean" ]; then shift make distclean find . -name config.cache -exec rm -f {} \; fi if [ "$1" = "configure" ]; then shift $SRCDIR/configure -v --enable-languages=c,c++,java \ --prefix=/rt/gcc --enable-threads=posix \ --with-system-zlib --enable-nls --without-included-gettext \ --enable-libgcj-debug \ --enable-__cxa_atexit --enable-clocale=gnu \ --without-x --disable-java-awt --disable-gtk-cairo --with-gnu-ld \ i486-linux fi if [ "$1" = "build" ]; then shift make GCJFLAGS="$GCJFLAGS" \ LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap fi if [ "$1" = "install" ]; then shift make install fi cd $PWD -- Summary: -Os causes bad build of libgcj.so.5.0.0 file Product: gcc Version: 3.4.2 Status: UNCONFIRMED Severity: critical Priority: P2 Component: libgcj AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: dick at softplc dot com CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu dot org GCC target triplet: i486-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17700