diff options
author | Kai Tietz <kai.tietz@onevision.com> | 2008-07-04 08:15:27 +0000 |
---|---|---|
committer | Kai Tietz <ktietz@gcc.gnu.org> | 2008-07-04 10:15:27 +0200 |
commit | 0b4b69ef79271e8e6a2dfa2eaa3376a75fa05d03 (patch) | |
tree | d1af1f94095ce5db28182a39c821328c23262a9b /gcc/tree-sra.c | |
parent | 9a0f2a1b986bfd0e0ba96a74af32631ffecb9e73 (diff) | |
download | gcc-0b4b69ef79271e8e6a2dfa2eaa3376a75fa05d03.zip gcc-0b4b69ef79271e8e6a2dfa2eaa3376a75fa05d03.tar.gz gcc-0b4b69ef79271e8e6a2dfa2eaa3376a75fa05d03.tar.bz2 |
config.gcc (extra_headers): Add cross-stdarg.h for target x86_64-*-* and i?86-*-*.
2008-07-04 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-04 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.
From-SVN: r137452
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r-- | gcc/tree-sra.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 391511f..c50c6cd 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -308,6 +308,26 @@ sra_type_can_be_decomposed_p (tree type) return false; } +/* Returns true if the TYPE is one of the available va_list types. + Otherwise it returns false. + Note, that for multiple calling conventions there can be more + than just one va_list type present. */ + +static bool +is_va_list_type (tree type) +{ + tree h; + + if (type == NULL_TREE) + return false; + h = targetm.canonical_va_list_type (type); + if (h == NULL_TREE) + return false; + if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (h)) + return true; + return false; +} + /* Return true if DECL can be decomposed into a set of independent (though not necessarily scalar) variables. */ @@ -360,9 +380,7 @@ decl_can_be_decomposed_p (tree var) tree-stdarg.c, as the decomposition is truly a win. This could also be fixed if the stdarg pass ran early, but this can't be done until we've aliasing information early too. See PR 30791. */ - if (early_sra - && TYPE_MAIN_VARIANT (TREE_TYPE (var)) - == TYPE_MAIN_VARIANT (va_list_type_node)) + if (early_sra && is_va_list_type (TREE_TYPE (var))) return false; return true; |