https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64384
daniel.c.klauer at web dot de changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |daniel.c.klauer at web dot de --- Comment #3 from daniel.c.klauer at web dot de --- It seems there is a difference between gcc and ms with regards to return in register for C++ methods (regardless of stdcall/cdecl/thiscall). Tested with i686-w64-mingw32 gcc 4.9.2 and cl.exe from VS 2010: struct A { int field1; }; struct A getA(void) { struct A a = {123}; return a; } C function: both gcc and ms return in register (struct is small enough), ok. struct A { int field1; }; class Test { public: A getA(); }; A Test::getA() { struct A a = {123}; return a; } C++ method: ms returns in temp var on stack (as for big structs), but gcc returns in register. The same happens for struct containing two floats (as in the original crash issue reported on mingw-w64 mailing list). Maybe (on 32bit) ms never uses return in register for C++ methods with aggregate result?