This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: [java, 3.0.1]: BUG: Unresolved symbols with -O3 and higher
- To: Jeff Sturm <jsturm at one-point dot com>
- Subject: Re: [java, 3.0.1]: BUG: Unresolved symbols with -O3 and higher
- From: Manfred Hollstein <manfred dot h at gmx dot net>
- Date: Wed, 25 Jul 2001 11:14:15 +0200
- CC: gcc-bugs at gcc dot gnu dot org, java at gcc dot gnu dot org
- References: <Pine.LNX.4.10.10107241259100.15490-100000@mars.deadcafe.org>
- Reply-To: manfred dot h at gmx dot net
Jeff Sturm wrote:
>
> On Tue, 24 Jul 2001, Manfred Hollstein wrote:
> > Funnily, the methods in question are used _and_ defined (in Java source
> > code, but obviously not emitted) in the corresponding .java file. Using
> > "-O2" (ie. no automatic function inlining) doesn't show this problem.
>
> "-fkeep-inline-functions" should be a viable workaround.
Thanks for your help. I just re-ran the build/check with this
flag added to GCJFLAGS and using -O3 instead of the former -O2,
and succeeded this time; results were the same as the reported ones
at <http://gcc.gnu.org/ml/gcc-testresults/2001-07/msg00445.html>
> I'll argue this should be the default for gcj, due to reflection. In fact
> the behavior of the program below changes when compiled with/without
> -fkeep-inline-functions:
What do other Java experts suggest here?
> import java.lang.reflect.Method;
>
> public class Junk {
> private void junk() {
> System.out.println("junk");
> }
>
> public static void main(String[] args) {
> try {
> Junk junk = new Junk();
> Method[] meths = junk.getClass().getDeclaredMethods();
> for (int n = 0; n < meths.length; n++)
> System.out.println(meths[n]);
> } catch (Throwable t) {
> t.printStackTrace();
> }
> }
> }
Cheers.
l8er
manfred