From: Kai Tietz Date: Mon, 7 Jul 2008 19:22:48 +0000 (+0000) Subject: i386.c (is_va_list_char_pointer): New. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8432ea85051b1ea9502b73c009856890189609a6;p=gcc.git i386.c (is_va_list_char_pointer): New. 2008-07-07 Kai Tietz * config/i386/i386.c (is_va_list_char_pointer): New. (ix86_va_start): Replace compare with ms_va_list_type_node by is_va_list_char_pointer. (ix86_gimplify_va_arg): Likewise. From-SVN: r137593 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7c37e08446f..e2a48fdb0b3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2008-07-07 Kai Tietz + + * config/i386/i386.c (is_va_list_char_pointer): New. + (ix86_va_start): Replace compare with ms_va_list_type_node + by is_va_list_char_pointer. + (ix86_gimplify_va_arg): Likewise. + 2008-07-07 Martin Jambor * cgraph.c (cgraph_edge_max_uid): New variable. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 7bedb76ce99..26999e71d5b 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -5408,6 +5408,21 @@ ix86_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, setup_incoming_varargs_64 (&next_cum); } +/* Checks if TYPE is of kind va_list char *. */ + +static bool +is_va_list_char_pointer (tree type) +{ + tree canonic; + + /* For 32-bit it is always true. */ + if (!TARGET_64BIT) + return true; + canonic = ix86_canonical_va_list_type (type); + return (canonic == ms_va_list_type_node + || (DEFAULT_ABI == MS_ABI && canonic == va_list_type_node)); +} + /* Implement va_start. */ static void @@ -5419,8 +5434,7 @@ ix86_va_start (tree valist, rtx nextarg) tree type; /* Only 64bit target needs something special. */ - if (!TARGET_64BIT || - ix86_canonical_va_list_type (TREE_TYPE (valist)) == ms_va_list_type_node) + if (!TARGET_64BIT || is_va_list_char_pointer (TREE_TYPE (valist))) { std_expand_builtin_va_start (valist, nextarg); return; @@ -5499,8 +5513,7 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p) enum machine_mode nat_mode; /* Only 64bit target needs something special. */ - if (!TARGET_64BIT || - ix86_canonical_va_list_type (TREE_TYPE (valist)) == ms_va_list_type_node) + if (!TARGET_64BIT || is_va_list_char_pointer (TREE_TYPE (valist))) return std_gimplify_va_arg_expr (valist, type, pre_p, post_p); f_gpr = TYPE_FIELDS (TREE_TYPE (sysv_va_list_type_node));