This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
gcj overoptimizes "final" declarations
- From: Roland Illig <news at rolands dot linux-site dot net>
- To: gnu-gcc-bug at moderators dot isc dot org
- Date: Mon, 16 Sep 2002 03:11:36 +0200
- Subject: gcj overoptimizes "final" declarations
- Newsgroups: gnu.gcc.bug
$ 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