[java, 3.0.1]: BUG: Unresolved symbols with -O3 and higher
Manfred Hollstein
manfred.h@gmx.net
Wed Jul 25 02:14:00 GMT 2001
Jeff Sturm wrote:
>> On 2001年7月24日, 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
More information about the Java
mailing list