This is the mail archive of the java-discuss@sourceware.cygnus.com 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]

Re: Optimisation bug (?)


> So, it looks as though private methods are a bit *too* private when used
>
> with optimisation, or I'm missing something (probably blindingly obvious
> :-)

I can confirm this. It looks like gcj decides that private methods are not
required when using -O3  ;-)

public class Private
{
  private static void sayHi()
  {
    System.out.println("Hi");
  }

  public static void main(String args[])
   {
     Private.sayHi();
   }
}

[bryce@pho-ku tests]$ gcj -O3 Private.java -o private --main=Private
/tmp/cccVaaaa.o: In function `Private::main(JArray<java::lang::String *>
*)':
/tmp/cccVaaaa.o(.text+0x2c): undefined reference to `Private::sayHi(void)'
collect2: ld returned 1 exit status

regards

  [ bryce ]



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