This is the mail archive of the java@gcc.gnu.org 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] |
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.
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:
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();
}
}
}
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |