[Bug java/28979] GCJ errors out when compiling .class files produced by Scala 2.1.8

2006-09-08 Thread vnasardinov at gmail dot com


--- Comment #5 from vnasardinov at gmail dot com  2006-09-09 01:05 ---
PR 28892 reminded me that I had forgotten to mention one thing.  The
attached program (attachment 12208) runs fine under gij.

To be more precise, it does more or less the same thing it does under
Sun's JDK.  Under Sun:

 | $ time java \
 |   -classpath /usr/local/scala/share/scala/lib/scala-library.jar:hamming.jar
\
 |   hamming
 | The first 20 numbers:
 | 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 27, 30, 32, 36
 | 
 | The 100th number (counting from 0): 1600
 | 
 | The 1000th:
 | Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
 | 
 | real 0m9.922s
 | user 0m6.532s
 | sys  0m2.780s


Under gij:

 | $ gij \
 |  --classpath /usr/local/scala/share/scala/lib/scala-library.jar:hamming.jar
\
 |  hamming
 | The first 20 numbers:
 | 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 27, 30, 32, 36
 | 
 | The 100th number (counting from 0): 1600
 | 
 | The 1000th:
 | Killed

Under Sun, it causes an OOM when trying to compute the 1000th Hamming
number.  Under gij, it starts paging like there is no tomorrow, but
keeps on going and hoses up my machine pretty quickly.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28979



[Bug libgcj/28979] GCJ errors out when compiling .class files produced by Scala 2.1.8

2006-09-07 Thread vnasardinov at gmail dot com


--- Comment #2 from vnasardinov at gmail dot com  2006-09-08 00:36 ---
Created an attachment (id=12209)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12209&action=view)
hamming.scala

the offending Scala program


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28979



[Bug libgcj/28979] GCJ errors out when compiling .class files produced by Scala 2.1.8

2006-09-07 Thread vnasardinov at gmail dot com


--- Comment #1 from vnasardinov at gmail dot com  2006-09-08 00:35 ---
Created an attachment (id=12208)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12208&action=view)
hamming.jar

the promised jar file


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28979



[Bug libgcj/28979] New: GCJ errors out when compiling .class files produced by Scala 2.1.8

2006-09-07 Thread vnasardinov at gmail dot com
I'm getting an error when trying to compile the following classes with
gcj:

 | $ scalac hamming.scala 
 | $ ls -lh *.class
 | -rw-rw-r-- 1 vadim vadim 1.1K Sep  7 20:16 hamming$$anonfun$0.class
 | -rw-rw-r-- 1 vadim vadim 1.1K Sep  7 20:16 hamming$$anonfun$1.class
 | -rw-rw-r-- 1 vadim vadim 1.1K Sep  7 20:16 hamming$$anonfun$2.class
 | -rw-rw-r-- 1 vadim vadim 1.5K Sep  7 20:16
hamming$$anonfun$3$$anonfun$4.class
 | -rw-rw-r-- 1 vadim vadim 1.5K Sep  7 20:16
hamming$$anonfun$3$$anonfun$5.class
 | -rw-rw-r-- 1 vadim vadim 1.5K Sep  7 20:16
hamming$$anonfun$3$$anonfun$6.class
 | -rw-rw-r-- 1 vadim vadim 1.3K Sep  7 20:16 hamming$$anonfun$3.class
 | -rw-rw-r-- 1 vadim vadim  868 Sep  7 20:16 hamming.class
 | -rw-rw-r-- 1 vadim vadim 2.4K Sep  7 20:16 hamming$.class
 | $ jar cf hamming.jar *.class
 | $ gcj --main=hamming
--classpath=/usr/local/scala/share/scala/lib/scala-library.jar hamming.jar 
 | hamming.scala: In class 'hamming$':
 | hamming.scala: In constructor '()':
 | hamming$.java:0: warning: assignment to final static field `MODULE$' not in
class initializer
 | /tmp/cc8cPsFr.s: Assembler messages:
 | /tmp/cc8cPsFr.s:85: Error: symbol `_ZN18hamming$$anonfun$05applyEv' is
already defined
 | /tmp/cc8cPsFr.s:514: Error: symbol `_ZN18hamming$$anonfun$15applyEv' is
already defined
 | /tmp/cc8cPsFr.s:841: Error: symbol `_ZN18hamming$$anonfun$25applyEv' is
already defined
 | /tmp/cc8cPsFr.s:2416: Error: symbol `_ZN18hamming$$anonfun$35applyEv' is
already defined

The .class files were produced by Scala 2.1.8:
  http://scala.epfl.ch/downloads/distrib/files/scala-2.1.8.tar.gz

The above is under the following version of GCJ:

 | $ gcj -v
 | Using built-in specs.
 | Reading specs from /usr/lib/gcc/x86_64-redhat-linux/4.1.1/libgcj.spec
 | rename spec lib to liborig
 | Target: x86_64-redhat-linux
 | Configured with: ../configure --prefix=/usr --mandir=/usr/share/man \
 |   --infodir=/usr/share/info --enable-shared --enable-threads=posix \
 |   --enable-checking=release --with-system-zlib --enable-__cxa_atexit \
 |   --disable-libunwind-exceptions --enable-libgcj-multifile \
 |   --enable-languages=c,c++,objc,obj-c++,java,fortran,ada \
 |   --enable-java-awt=gtk --disable-dssi \
 |   --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre \
 |   --with-cpu=generic --host=x86_64-redhat-linux
 | Thread model: posix
 | gcc version 4.1.1 20060525 (Red Hat 4.1.1-1)

I will attach the offending .jar file in a minute.


-- 
   Summary: GCJ errors out when compiling .class files produced by
Scala 2.1.8
   Product: gcc
   Version: 4.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libgcj
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: vnasardinov at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28979



[Bug java/27104] static final variable not being tracked as being set correctly

2006-04-10 Thread vnasardinov at gmail dot com


--- Comment #3 from vnasardinov at gmail dot com  2006-04-10 19:15 ---
Thanks.  It would help to have the words "definite assignment"
and/or "definitely unassigned" and/or
http://java.sun.com/docs/books/jls/third_edition/html/defAssign.html
somewhere in the summary or comments, so people can find it
before filing duplicates.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27104



[Bug libgcj/27104] definite assingment bug in GCJ

2006-04-10 Thread vnasardinov at gmail dot com


--- Comment #1 from vnasardinov at gmail dot com  2006-04-10 19:02 ---
Created an attachment (id=11237)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11237&action=view)
the test case 

This comes from http://www.javapuzzlers.com/java-puzzlers.zip with minor
modifications.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27104



[Bug libgcj/27104] New: definite assingment bug in GCJ

2006-04-10 Thread vnasardinov at gmail dot com
All of the compiler versions are the same as in bug 27101.

Sun's compiler:

| $ javac UnwelcomeGuest.java 
| UnwelcomeGuest.java:9: variable USER_ID might already have been assigned
| USER_ID = GUEST_USER_ID;
| ^
| 1 error

The Eclipse compiler:

| $ ecj UnwelcomeGuest.java 
| --
| 1. ERROR in UnwelcomeGuest.java
|  (at line 9)
|   USER_ID = GUEST_USER_ID;
|   ^^^
| The final field USER_ID may already have been assigned
| --
| 1 problem (1 error)

GCJ:

| $ gcj -C UnwelcomeGuest.java 
| $ echo $?
| 0

Will attach the test case momentarily.


-- 
   Summary: definite assingment bug in GCJ
   Product: gcc
   Version: 4.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libgcj
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: vnasardinov at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27104



[Bug java/27101] GCJ rejects valid code (for Sun's measure of "valid')

2006-04-10 Thread vnasardinov at gmail dot com


--- Comment #2 from vnasardinov at gmail dot com  2006-04-10 18:12 ---
Tom Fitzsimmons stopped complaining about my pipe-quoting technique
after I told him about "M-x delete-rectangle" a.k.a. "C-x r d".  Takes
about 5 seconds in Emacs to fix this up. One, if you type really fast :)

Thanks for looking at this.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27101



[Bug libgcj/27101] New: GCJ rejects valid code (for Sun's measure of "valid')

2006-04-10 Thread vnasardinov at gmail dot com
This is probably a duplicate of something that has been filed before,
but my cursory search failed to turn up any similar tickets.

GCJ rejects code that both Sun and Eclipse compilers accept.

Here's the test case:

| $ cat Reluctant.java
| public class Reluctant {
| private Reluctant internalInstance = new Reluctant();
|
| public Reluctant() throws Exception {
| throw new Exception("I'm not coming out");
| }
|
| public static void main(String[] args) {
| try {
| Reluctant b = new Reluctant();
| System.out.println("Surprise!");
| } catch (Exception ex) {
| System.out.println("I told you so");
| }
| }
| }

The test comes from
http://www.javapuzzlers.com/java-puzzlers.zip


Here's what I'm using

| $ gcj -v
| Using built-in specs.
| Reading specs from /usr/lib/gcc/x86_64-redhat-linux/4.1.0/libgcj.spec
| rename spec lib to liborig
| Target: x86_64-redhat-linux
| Configured with: ../configure --prefix=/usr --mandir=/usr/share/man \
|  --infodir=/usr/share/info --enable-shared --enable-threads=posix \
|  --enable-checking=release --with-system-zlib --enable-__cxa_atexit \
|  --disable-libunwind-exceptions --enable-libgcj-multifile \
|  --enable-languages=c,c++,objc,obj-c++,java,fortran,ada \
|  --enable-java-awt=gtk --disable-dssi \
|  --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre \
|  --with-cpu=generic --host=x86_64-redhat-linux
|
| Thread model: posix
| gcc version 4.1.0 20060304 (Red Hat 4.1.0-3)

Here's the compilation error the above code triggers:

| $ gcj -C Reluctant.java
| Reluctant.java: In class 'Reluctant':
| Reluctant.java: In method 'finit$()':
| Reluctant.java:2: error: Exception $-1òøjava.lang.Exceptionòù can't be
thrown in initializer.
| private Reluctant internalInstance = new Reluctant();
| ^
| 1 error

Here's what the Eclipse compiler has to say:

| $ ecj -v
| Eclipse Java Compiler v_585_R31x, 3.1.2 release, Copyright IBM Corp 2000,
2006. All rights reserved.
| $ ecj Reluctant.java
| --
| 1. WARNING in Reluctant.java
|  (at line 2)
|   private Reluctant internalInstance = new Reluctant();
| 
| The field Reluctant.internalInstance is never read locally
| --
| --
| 2. WARNING in Reluctant.java
|  (at line 10)
|   Reluctant b = new Reluctant();
| ^
| The local variable b is never read
| --
| 2 problems (2 warnings)

No errors.

Same with Sun's javac:

| $ javac -version 2>&1 | head -n1
| javac 1.5.0_06
| $ javac -Xlint Reluctant.java
| $ echo $?
| 0


-- 
   Summary: GCJ rejects valid code (for Sun's measure of "valid')
   Product: gcc
   Version: 4.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
     Component: libgcj
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: vnasardinov at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27101