This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the GCJ project. See the GCJ home page for more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

GCJ fails with -O?


I have a test case that seems to break the compiler.  The Fcrypt.java
class is a port of Eric Young's fast crypt() routines to Java.  It's
packed with bit manipulations... should be a good test for
gcj.

Compiling with no optimization works:

    [jsturm@bangkok tmp]$ gcj --main=Fcrypt Fcrypt.java -o fcrypt
    [jsturm@bangkok tmp]$ ./fcrypt abracadabra xy
    xy..nHGb.whyc

Compiling with -O fails to link:

    [jsturm@bangkok tmp]$ gcj -O --main=Fcrypt Fcrypt.java -o fcrypt
    /tmp/ccWfcaaa.o: In function `Fcrypt::_003cclinit_003e(unsigned)':
    /tmp/ccWfcaaa.o(.text+0x269): undefined reference to `LJv16'
    collect2: ld returned 1 exit status

This is on Linux/x86 with the current gcj from CVS.  I can provide
Fcrypt.java by email if someone wants to take a look (I think it's
subject to US export restrictions, or I'd post a link here).

-- 
Jeff Sturm
jsturm@sigma6.com