This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch i386]: Set for method-functions default calling-convention to thiscall for 32-bit msabi
- From: Nathan Froyd <froydnj at codesourcery dot com>
- To: Kai Tietz <ktietz70 at googlemail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Richard Henderson <rth at redhat dot com>
- Date: Fri, 1 Apr 2011 10:43:09 -0700
- Subject: Re: [patch i386]: Set for method-functions default calling-convention to thiscall for 32-bit msabi
- References: <AANLkTi=1VST9Ga9S+FEA6mZx6BY_bKAi4Qck-WcoOQRk@mail.gmail.com>
On Fri, Apr 01, 2011 at 07:39:13PM +0200, Kai Tietz wrote:
> this patch sets for c++ methods, which are not stdarg ones, the
> default calling-convention to thiscall for ms_abi 32-bit, as vendor
> specific compiler does.
I think it might be worthwhile to pull this pattern:
> @@ -5500,7 +5524,8 @@ ix86_function_regparm (const_tree type,
> if (lookup_attribute ("fastcall", TYPE_ATTRIBUTES (type)))
> return 2;
>
> - if (lookup_attribute ("thiscall", TYPE_ATTRIBUTES (type)))
> + if (lookup_attribute ("thiscall", TYPE_ATTRIBUTES (type))
> + || ix86_is_msabi_thiscall (type))
into a separate function.? That function could also be used for
negative tests like this one:
> @@ -9799,7 +9826,8 @@ find_drap_reg (void)
> && !lookup_attribute ("fastcall",
> TYPE_ATTRIBUTES (TREE_TYPE (decl)))
> && !lookup_attribute ("thiscall",
> - TYPE_ATTRIBUTES (TREE_TYPE (decl))))
> + TYPE_ATTRIBUTES (TREE_TYPE (decl)))
> + && ! ix86_is_msabi_thiscall (TREE_TYPE (decl)))
WDYT?
-Nathan