http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51500
--- Comment #10 from Kai Tietz <ktietz at gcc dot gnu.org> 2012-01-30 07:29:28 UTC --- Hmm, not sure if you already noticed it, but ffi_call supports by recent patch thiscall/fastcall convention. So parts of you patch won't apply mainline.