[patch i386] Enable attribute based calling convention switching and support vaarg.

Richard Guenther richard.guenther@gmail.com
Mon Jun 30 15:37:00 GMT 2008


On Mon, Jun 30, 2008 at 3:57 PM, Kai Tietz <Kai.Tietz@onevision.com> wrote:
> Hello,
>
> "Richard Guenther" <richard.guenther@gmail.com> wrote on 30.06.2008
> 14:06:24:
>> In this context the gimplify_va_arg_expr hunk should properly use
>> want_va_type and have_va_type to the function decls parameter type
>> and the argument type.  In the current state of the patch it is
> confusing
>> what is actually done.
>
> One problem I see here is that have_va_type and want_va_type are getting
> modified for comparision. This leads to the problem, that the type
> afterwards used in

I don't see a problem here.  If you do

want_va_type = cfun_abi_type
have_va_type = canonical_va_type (TREE_TYPE (valist))

then things should just work.  In fact, even the canonicalization
of have_va_type should not be necessary in this function.

Richard.

> ...
>      /* Make it easier for the backends by protecting the valist argument
>         from multiple evaluations.  */
>      if (TREE_CODE (abi_type) == ARRAY_TYPE)
>        {
>          /* For this case, the backends will be expecting a pointer to
>             TREE_TYPE (abi), but it's possible we've
>             actually been given an array (an actual
> TARGET_FN_ABI_VA_LIST).
>             So fix it.  */
>          if (TREE_CODE (TREE_TYPE (valist)) == ARRAY_TYPE)
>            {
>              tree p1 = build_pointer_type (TREE_TYPE (abi_type));
>              valist = build_fold_addr_expr_with_type (valist, p1);
>            }
>          gimplify_expr (&valist, pre_p, post_p, is_gimple_val,
> fb_rvalue);
>        }
>      else
>        gimplify_expr (&valist, pre_p, post_p, is_gimple_min_lval,
> fb_lvalue);
> ...
>
> would have false type for TREE_CODE(want_type). IMHO the helper variable
> (abi_type) is necessary. Maybe it could be named different?
>
> Kai
>
> |  (\_/)  This is Bunny. Copy and paste Bunny
> | (='.'=) into your signature to help him gain
> | (")_(") world domination.
>
>



More information about the Gcc-patches mailing list