[patch i386]: Enable ms_abi/sysv_abi and add testcases

Kai Tietz Kai.Tietz@onevision.com
Fri Jun 20 14:26:00 GMT 2008


Hello Honza,

Jan Hubicka <hubicka@ucw.cz> wrote on 19.06.2008 19:39:31:

> > Index: gcc/gcc/testsuite/gcc.dg/callabi/callabi.h
> > ===================================================================
> > --- /dev/null
> > +++ gcc/gcc/testsuite/gcc.dg/callabi/callabi.h
> > @@ -0,0 +1,50 @@
> > +/* First the default target definition.  */
> > +#ifndef __GNUC_VA_LIST
> > +#define __GNUC_VA_LIST
> > +  typedef __builtin_va_list __gnuc_va_list;
> > +#endif
> > +
> > +#ifndef _VA_LIST_DEFINED
> > +#define _VA_LIST_DEFINED
> > +  typedef __gnuc_va_list va_list;
> > +#endif
> 
> The user interface seems quite sane, I think we ought to provide some
> user API however, like cross-stdarg.h available in similar way as
> xmmintrin.h definitng the ms and sysv variant of va_* functions
> similarly to the hunk bellow.  Probably dropping __s?
Well, we can add this after getting it work properly.

> > Index: gcc/gcc/config/i386/i386.c
> > ===================================================================
> > --- gcc.orig/gcc/config/i386/i386.c
> > +++ gcc/gcc/config/i386/i386.c
> > @@ -1711,6 +1711,9 @@ unsigned int ix86_preferred_stack_bounda
> >  /* Values 1-5: see jump.c */
> >  int ix86_branch_cost;
> > 
> 
> Comment here.
Done.

> > +static tree sysv_va_list_type_node;
> > +static tree ms_va_list_type_node;
> > +
> 
> > 
> > +/* Returns the calling convention specific va_list date type.
> > +   The argument ABI can be DEFAULT_ABI, MS_ABI, or SYSV_ABI.  */
> > +
> >  static tree
> > -ix86_build_builtin_va_list (void)
> > +ix86_build_builtin_va_list_abi (int abi)
> 
> Probably we could give ABI enum name nad use "enum abi" instead of int?
> 
> Otherwise the i386 specific parts seems fine.
> I will try to look into generic bits now, but I can't approve those.
> 
> Honza
> 

I gave the enum an name and added the comment for calling abi specific 
va_list type variables in i386.c.
I added an new additional hook type_abi_va_list, which gets a type and 
returns the corresponding va_list type. As default it returns the standard 
cfun_abi_va_list value.

I added two new testcases. The vaarg-2.c works for me well on w64->x86_64. 
The testcase vaarg-3.c fails for some reason on execute. May you could 
take a look what's going wrong here. I searched and found nothing 
specific.



Regards,
 i.A. Kai Tietz

|  (\_/)  This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: callabi_tstcase.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080620/fd1f5462/attachment.txt>


More information about the Gcc-patches mailing list