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]
Other format: [Raw text]

Re: bad news re: mingw exceptions


Adam Megacz wrote:

>>These aren't really c++ exceptions in your example.  Because you're
>>compiling CNI, g++ is impersonating Java exceptions.
>>
>
>Huh, very strange -- if the same code gets emitted, why would the two
>programs behave differently?
>

The two front ends might be generating different code even though they 
are using the same EH runtime.

>At compile time, how does g++ know that test.cc will get linked
>against Java code later on (and hence should emit code for Java
>exceptions, not C++ exceptions)?
>

#pragma gcc java_exceptions

This is declared in some header which is #included from all the CNI 
headers. I think g++ also switches automatically to Java mode when it 
sees a throw or catch of a Java type.

>When I tried to link without -lsupc++ I got unresolved symbols --
>doesn't this mean it's trying to call C++ exceptioning stuff?
>

If its missing __g++_eh_personality or some such symbol, you're using 
C++ EH. If its missing __gcj_eh_personality, you're using Java EH. The 
C++ EH runtime is in libsupc++. The Java EH runtime is in libgcj.

>If the Java and C++ exceptioning mechanisms are totally different, has
>anything changed in the Java ones? 
>

My first suspect would be the builtins patch. This is a random guess. 
Maybe __builtin_setjmp() is broken.

Could you compile your minimal test case with "-O2 -S -fverbose-asm" and 
post the resulting .s file?

regards

Bryce.



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