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] Enable attribute based calling convention switching and support vaarg.


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

...
      /* 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.


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