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] | |
Hello Richard,
"Richard Guenther" <richard.guenther@gmail.com> wrote on 30.06.2008
17:24:57:
> 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.
No, because even in *foreign* calling convention the va_arg call needs to
generated properly. So the use of cfun_abi_type is wrong here. Otherwise
the testcases vaarg-2.c and vaarg-3.c won't work. I elliminated in my
patch the want_va_list type completly, because it makes here less sense.
If the canonical call of TREE_TYPE(valist) is returning a NULL_TREE, it is
sure that the passed in argument type is not a valid va_list type. So it
seems to be enough to check if have_va_type is NULL_TREE for the error
checking. I adjusted the std_canonical_va_type () function to return
NULL_TREE if type is not va_list_type_node.
ChangeLog
2008-07-01 Kai Tietz <kai.tietz@onevision.com>
* config.gcc (extra_headers): Add cross-stdarg.h for target
x86_64-*-* and i?86-*-*.
* config/i386/cross-stdarg.h: New.
* builtins.c (std_fn_abi_va_list): New.
(std_canonical_va_list_type): New.
(stabilize_va_list): Replace va_list_type_node use by
mtarget.canonical_va_list_type.
(gimplify_va_arg_expr): Likewise.
(expand_builtin_va_copy): Replace va_list_type_node use by
mtarget.fn_abi_va_list.
* tree-sra.c (is_va_list_type): New helper.
(decl_can_be_decomposed_p): Replace
va_list_type_node use by is_va_list_type.
* tree-ssa-ccp.c (optimize_stdarg_builtin): Likewise.
* tree-stdarg.c (execute_optimize_stdarg): Likewise.
* c-common.c (c_common_nodes_and_builtins): Use
TARGET_ENUM_VA_LIST.
* config/i386/i386-protos.h (ix86_get_valist_type): New.
(ix86_enum_va_list): New.
* config/i386/i386.c (sysv_va_list_type_node): New.
(ms_va_list_type_node): New.
(ix86_function_type_abi): Remove sorry.
(ix86_build_builtin_va_list_abi): New.
(ix86_build_builtin_va_list): Call ix86_build_builtin_va_list_abi
for 64-bit targets.
(ix86_va_start): Replace va_list_type_node by
sysv_va_list_type_node.
(ix86_init_builtins_va_builtins_abi): New.
(ix86_init_builtins): Use ix86_init_builtins_va_builtins_abi
for 64-bit targets.
(ix86_handle_abi_attribute): New.
(attribute_spec): Add sysv_abi and ms_abi.
(ix86_fn_abi_va_list): New.
(ix86_canonical_va_list_type): New.
(ix86_enum_va_list): New.
(TARGET_FN_ABI_VA_LIST): New.
(TARGET_CANONICAL_VA_LIST_TYPE): New.
* config/i386/i386.h (TARGET_ENUM_VA_LIST): New.
* doc/tm.texi (TARGET_FN_ABI_VA_LIST): New.
(TARGET_CANONICAL_VA_LIST_TYPE): New.
(TARGET_ENUM_VA_LIST): New.
* expr.h (std_fn_abi_va_list): New.
(std_canonical_va_list_type): New.
* target-def.h (TARGET_FN_ABI_VA_LIST): New.
(TARGET_CANONICAL_VA_LIST_TYPE): New.
(TARGET_INITIALIZER): Add TARGET_FN_ABI_VA_LIST and
TARGET_CANONICAL_VA_LIST_TYPE.
* target.h (struct gcc_target): Add fn_abi_va_list hook
and canonical_va_list_type hook.
2008-07-01 Kai Tietz <kai.tietz@onevision.com>
* gcc.dg/callabi/callabi.h: New.
* gcc.dg/callabi/vaarg-1.c: New.
* gcc.dg/callabi/vaarg-2.c: New.
* gcc.dg/callabi/vaarg-3.c: New.
* gcc.dg/callabi/func-1.c: New.
I tested this patch on x86_64-pc-mingw32 target. All new testcases
work without any problems.
Is this patch ok for apply?
Cheers,
Kai
Attachment:
callabi_tstcase.txt
Description: Text document
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |