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]

Re: [java, 3.0.1]: BUG: Unresolved symbols with -O3 and higher


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


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