This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

gcj overoptimizes "final" declarations


$ cat Fib.java
public class Fib
{
    static private final int fib(int n)
    {
        if (n < 2)
            return n;
        return fib(n-1) + fib(n-2);
    }
 
    public static void main(String[] args)
    {
        System.out.println(fib(Integer.parseInt(args[0])));
    }
}
$ gcj -O2 -Wall -W --main=Fib -o Fib.gcc Fib.java
$ gcj -O3 -Wall -W --main=Fib -o Fib.gcc Fib.java
/tmp/ccaFOF35.o: In function `Fib::main(JArray<java::lang::String *> *)':
/tmp/ccaFOF35.o(.text+0x5b): undefined reference to `Fib::fib(int)'
collect2: ld returned 1 exit status


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