------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-06 01:48 ------- Reduced testcase: extern "Java" { namespace java { namespace lang { class Class; class Throwable; } } } typedef class java::lang::Class* jclass; typedef class java::lang::Throwable* jthrowable; typedef struct _Jv_JNIEnv JNIEnv; struct _Jv_JNIEnv { jthrowable ex; }; class java::lang::Throwable { static ::java::lang::Class class$; }; void f(void); void g (JNIEnv *env) { try { f(); } catch (jthrowable t) { env->ex = t; } }
But I think we have a C++ or exand bug: <bb 0>: f (); goto <bb 2> (<L1>); <L0>:; D.1724 = (struct Throwable * *) <<<exception object>>>; env->ex = *(D.1724 - 4); that is what we get. notice how the load/store is in the same BB which means the load is marked as NO_THROW. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23711