From 7520518f731935ae46aeb4f1d276585d7aa8e0ba Mon Sep 17 00:00:00 2001 From: Kai Tietz Date: Mon, 12 Dec 2011 11:40:27 +0100 Subject: [PATCH] re PR libgcj/50053 (jc1 doesn't emit static initializer or initializer code for super class without -findirect-dispatch.) PR libgcj/50053 * java/lang/natClass.cc (java::lang::Class::newInstance): Special case member-call for 32-bit IA native Window target. From-SVN: r182225 --- libjava/ChangeLog | 6 ++++++ libjava/java/lang/natClass.cc | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index e856e4b65d7..08d4faa1314 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2011-12-12 Kai Tietz + + PR libgcj/50053 + * java/lang/natClass.cc (java::lang::Class::newInstance): Special case + member-call for 32-bit IA native Window target. + 2011-11-24 Jakub Jelinek PR bootstrap/50888 diff --git a/libjava/java/lang/natClass.cc b/libjava/java/lang/natClass.cc index ec4a18f1b51..b5ad91f2252 100644 --- a/libjava/java/lang/natClass.cc +++ b/libjava/java/lang/natClass.cc @@ -661,7 +661,13 @@ java::lang::Class::newInstance (void) throw new java::lang::InstantiationException (getName()); jobject r = _Jv_AllocObject (this); + /* Class constructors/destructors have __thiscall calling + convention for 32-bit native Windows ABI. */ +#if defined (__MINGW32__) && defined (__i386__) + ((void (__thiscall *) (jobject)) meth->ncode) (r); +#else ((void (*) (jobject)) meth->ncode) (r); +#endif return r; }