This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Is this a bug?


Hi!
I got a strange result with gcj on linux here:

$ cat hello.java
public class hello
{
    final static long a = 1000000000;
    final static long b = 1000 * a;

    public static void main(String[] args)
    {
        System.out.println("a = " + a);
        System.out.println("b = " + b);
    }
}

$ gcj -o hello hello.java --main=hello
$ ./hello
a = 1000000000
b = -727379968

$ javac hello.java 
$ java hello
a = 1000000000
b = 1000000000000

$ gcj -v
Reading specs from /usr/local/snapshots/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/specs
Reading specs from /usr/local/snapshots/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/../../../libgcj.spec
rename spec lib to liborig
Configured with: ../gcc-20020902/configure --prefix=/usr/local/snapshots
--enable-languages=f77,c++,java --disable-threads --enable-shared=libstdc++
Thread model: single
gcc version 3.2.1 20020902 (prerelease)

Any idea?

Thanks in advance,
Martin.

-- 
The early bird catches the worm. If you want something else for       
breakfast, get up later.


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