This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch i386]: Set for method-functions default calling-convention to thiscall for 32-bit msabi


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]