[M3devel] Latest parse.c

Tony Hosking hosking at cs.purdue.edu
Mon Feb 4 23:14:16 CET 2008


See this snip from gcc/gcc/config/winnt.c:

>   formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl));
>   if (formal_type != NULL_TREE)
>     {
>       /* These attributes are ignored for variadic functions in
> 	 i386.c:ix86_return_pops_args. For compatibility with MS
>          compiler do not add @0 suffix here.  */
>       if (TREE_VALUE (tree_last (formal_type)) != void_type_node)
>         return DECL_ASSEMBLER_NAME (decl);

We need a void_type_node there -- void_list_node now captures that  
properly.

>       /* Quit if we hit an incomplete type.  Error is reported
>          by convert_arguments in c-typeck.c or cp/typeck.c.  */

I wonder if the remaining problem with the wrong @N value is because  
we don't have a complete type on the formals?

>       while (TREE_VALUE (formal_type) != void_type_node
> 	     && COMPLETE_TYPE_P (TREE_VALUE (formal_type)))	
> 	{
> 	  int parm_size
> 	    = TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type)));
> 	    /* Must round up to include padding.  This is done the same
> 	       way as in store_one_arg.  */
> 	  parm_size = ((parm_size + PARM_BOUNDARY - 1)
> 		       / PARM_BOUNDARY * PARM_BOUNDARY);
> 	  total += parm_size;
> 	  formal_type = TREE_CHAIN (formal_type);\
> 	}
>      }





More information about the M3devel mailing list