This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: FAQ Update
Bryce McKinlay wrote:
>
> Jeff Sturm wrote:
>
> > I'm working with the CVS trunk for now, with various patches applied... I
> > can compile libgcj with -O2, almost (jc1 dumps core on MessageFormat.java
> > and Vector.java).
>
> I get this too. Perhaps you could file a PR?
I assumed it was an optimizer bug, or something not specific to gcj...
> Also, there is a possible nasty
> CNI problem - when attempting to build libgcj with -O2, the linker gets a bunch of
> messages like:
>
> .libs/libgcj.so: undefined reference to
> `java::net::InetAddress::checkConnect(java::lang::String *)'
>
> private static methods are being optimized away or inlined by the compiler, and thus
> unable to be called from within the classes own native counterpart!
Are you using Alexandre's DECL_INLINE patches? I saw this too... I
worked around it by marking a few particular methods `final' instead of
`private'... they are still inlined but not optimized away.
I presume the c++ compiler takes similar liberties with private methods.
I'm unconvinced this is a terrible thing, though it does break some
native code. There are funny side effects of the whole Java/C++
dichotomy created by CNI, among them that jc1 can't inline native code
and vice-versa. The two languages are handled by separate compilers and
they can't always tell what the other is doing... they are connected by
a vtable, period.
--
Jeff Sturm
jsturm@sigma6.com