builtins.c (std_build_builtin_va_list): New.
authorRichard Henderson <rth@redhat.com>
Thu, 30 Oct 2003 02:02:49 +0000 (18:02 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 30 Oct 2003 02:02:49 +0000 (18:02 -0800)
* builtins.c (std_build_builtin_va_list): New.
* expr.h (std_build_builtin_va_list): Declare.
* defaults.h (BUILD_VA_LIST_TYPE): New.
* system.h (BUILD_VA_LIST_TYPE): Poison.
* target-def.h (TARGET_BUILD_BUILTIN_VA_LIST): New.
* target.h (struct gcc_target): Add build_builtin_va_list.
* tree.c (build_common_tree_nodes_2): Use it.

* config/alpha/alpha-protos.h, config/alpha/alpha.c,
config/alpha/alpha.h, config/alpha/unicosmk.h,
config/d30v/d30v-protos.h, config/d30v/d30v.c, config/d30v/d30v.h,
config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.h,
config/i860/i860-protos.h, config/i860/i860.c, config/i860/i860.h,
config/i960/i960-protos.h, config/i960/i960.c, config/i960/i960.h,
config/mips/iris6.h, config/mips/mips-protos.h, config/mips/mips.c,
config/mips/mips.h, config/rs6000/rs6000-protos.h,
config/rs6000/rs6000.c, config/rs6000/rs6000.h,
config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h,
config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.h,
config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c,
config/xtensa/xtensa.h: Rename foo_build_va_list to
foo_build_builtin_va_list; make it static.  Define
TARGET_BUILD_BUILTIN_VA_LIST.  Remove BUILD_VA_LIST_TYPE.
Update protos.

* config/i386/i386.c (ix86_expand_carry_flag_compare): Make static.
* config/iq2000/iq2000.h (BUILD_VA_LIST_TYPE): Remove.

From-SVN: r73076

41 files changed:
gcc/ChangeLog
gcc/builtins.c
gcc/config/alpha/alpha-protos.h
gcc/config/alpha/alpha.c
gcc/config/alpha/alpha.h
gcc/config/alpha/unicosmk.h
gcc/config/d30v/d30v-protos.h
gcc/config/d30v/d30v.c
gcc/config/d30v/d30v.h
gcc/config/i386/i386-protos.h
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/config/i860/i860-protos.h
gcc/config/i860/i860.c
gcc/config/i860/i860.h
gcc/config/i960/i960-protos.h
gcc/config/i960/i960.c
gcc/config/i960/i960.h
gcc/config/iq2000/iq2000.h
gcc/config/mips/iris6.h
gcc/config/mips/mips-protos.h
gcc/config/mips/mips.c
gcc/config/mips/mips.h
gcc/config/rs6000/rs6000-protos.h
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.h
gcc/config/s390/s390-protos.h
gcc/config/s390/s390.c
gcc/config/s390/s390.h
gcc/config/sh/sh-protos.h
gcc/config/sh/sh.c
gcc/config/sh/sh.h
gcc/config/xtensa/xtensa-protos.h
gcc/config/xtensa/xtensa.c
gcc/config/xtensa/xtensa.h
gcc/defaults.h
gcc/expr.h
gcc/system.h
gcc/target-def.h
gcc/target.h
gcc/tree.c

index 6d6b39f4493c78dc4ba14b6bab2e1435d1e4dd87..80dd00f8866b5b085c9c6c9228be4e7042093b60 100644 (file)
@@ -1,3 +1,33 @@
+2003-10-29  Richard Henderson  <rth@redhat.com>
+
+       * builtins.c (std_build_builtin_va_list): New.
+       * expr.h (std_build_builtin_va_list): Declare.
+       * defaults.h (BUILD_VA_LIST_TYPE): New.
+       * system.h (BUILD_VA_LIST_TYPE): Poison.
+       * target-def.h (TARGET_BUILD_BUILTIN_VA_LIST): New.
+       * target.h (struct gcc_target): Add build_builtin_va_list.
+       * tree.c (build_common_tree_nodes_2): Use it.
+
+       * config/alpha/alpha-protos.h, config/alpha/alpha.c, 
+       config/alpha/alpha.h, config/alpha/unicosmk.h,
+       config/d30v/d30v-protos.h, config/d30v/d30v.c, config/d30v/d30v.h,
+       config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.h,
+       config/i860/i860-protos.h, config/i860/i860.c, config/i860/i860.h,
+       config/i960/i960-protos.h, config/i960/i960.c, config/i960/i960.h,
+       config/mips/iris6.h, config/mips/mips-protos.h, config/mips/mips.c,
+       config/mips/mips.h, config/rs6000/rs6000-protos.h, 
+       config/rs6000/rs6000.c, config/rs6000/rs6000.h,
+       config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h,
+       config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.h,
+       config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c,
+       config/xtensa/xtensa.h: Rename foo_build_va_list to
+       foo_build_builtin_va_list; make it static.  Define
+       TARGET_BUILD_BUILTIN_VA_LIST.  Remove BUILD_VA_LIST_TYPE.
+       Update protos.
+
+       * config/i386/i386.c (ix86_expand_carry_flag_compare): Make static.
+       * config/iq2000/iq2000.h (BUILD_VA_LIST_TYPE): Remove.
+
 2003-10-29  James E Wilson  <wilson@specifixinc.com>
 
        * recog.c (asm_operand_ok): Add missing break after case 'X'.
index 39156ebb62e70cbed462bff0dc813c116a35e7f1..23b0acfb801ea6ecf18247216c7ab4cc8dae5d32 100644 (file)
@@ -3910,6 +3910,14 @@ stabilize_va_list (tree valist, int needs_lvalue)
   return valist;
 }
 
+/* The "standard" definition of va_list is void*.  */
+
+tree
+std_build_builtin_va_list (void)
+{
+  return ptr_type_node;
+}
+
 /* The "standard" implementation of va_start: just assign `nextarg' to
    the variable.  */
 
index 29caf8f095b383bf4c42431bfb6f5eb9dc52ebfb..95f1ad25c7c6638bb139731d7f6d14b3b3c52f75 100644 (file)
@@ -80,7 +80,6 @@ extern void print_operand (FILE *, rtx, int);
 extern void print_operand_address (FILE *, rtx);
 extern void alpha_initialize_trampoline (rtx, rtx, rtx, int, int, int);
 
-extern tree alpha_build_va_list (void);
 extern void alpha_va_start (tree, rtx);
 extern rtx alpha_va_arg (tree, tree);
 extern rtx function_arg (CUMULATIVE_ARGS, enum machine_mode, tree, int);
index d90103e703e16f375d372322b9e510a009950ec9..0d59c343d843607fe8df7ec7d68e74bc16bac6ba 100644 (file)
@@ -6080,8 +6080,8 @@ function_value (tree valtype, tree func ATTRIBUTE_UNUSED,
   return gen_rtx_REG (mode, regnum);
 }
 
-tree
-alpha_build_va_list (void)
+static tree
+alpha_build_builtin_va_list (void)
 {
   tree base, ofs, record, type_decl;
 
@@ -10188,6 +10188,9 @@ alpha_init_libfuncs (void)
 #undef TARGET_PRETEND_OUTGOING_VARARGS_NAMED
 #define TARGET_PRETEND_OUTGOING_VARARGS_NAMED hook_bool_CUMULATIVE_ARGS_true
 
+#undef TARGET_BUILD_BUILTIN_VA_LIST
+#define TARGET_BUILD_BUILTIN_VA_LIST alpha_build_builtin_va_list
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 \f
index a6d332207095b4e5db090664c69006233e6ae038..2855351e9fac7f8782c2a247632256a8c40400af 100644 (file)
@@ -1679,10 +1679,6 @@ do {                                             \
   {"some_small_symbolic_operand", {SET, PARALLEL, PREFETCH, UNSPEC,    \
                                   UNSPEC_VOLATILE}},
 \f
-/* Define the `__builtin_va_list' type for the ABI.  */
-#define BUILD_VA_LIST_TYPE(VALIST) \
-  (VALIST) = alpha_build_va_list ()
-
 /* Implement `va_start' for varargs and stdarg.  */
 #define EXPAND_BUILTIN_VA_START(valist, nextarg) \
   alpha_va_start (valist, nextarg)
index c7f2bfe4aa724d41b46576aaee7305508dcb893f..46877fbc2bd32c338db9d4bf299c2bc0231191ca 100644 (file)
@@ -496,7 +496,6 @@ ssib_section ()                     \
 #undef LIB_SPEC
 #define LIB_SPEC "-L/opt/ctl/craylibs/craylibs -lu -lm -lc -lsma"
 
-#undef BUILD_VA_LIST_TYPE
 #undef EXPAND_BUILTIN_VA_START
 #undef EXPAND_BUILTIN_VA_ARG
 
index 7ce90afbfbb96203eb495bcde444d5d880a4fa6d..cd5be23105ab91f83222b1dbacb82c1310e89bbf 100644 (file)
@@ -103,7 +103,6 @@ extern rtx d30v_expand_builtin_saveregs     PARAMS ((void));
 extern void d30v_setup_incoming_varargs        PARAMS ((CUMULATIVE_ARGS *,
                                                 enum machine_mode,
                                                 tree, int *, int));
-extern tree d30v_build_va_list         PARAMS ((void));
 #ifdef RTX_CODE
 extern void d30v_expand_builtin_va_start PARAMS ((tree, rtx));
 extern rtx d30v_expand_builtin_va_arg  PARAMS ((tree, tree));
index 4093ab27abf75751e79de3825a80f03981519a8a..aadba9d794c4b687d3f81617c5169f1f9b96a601 100644 (file)
@@ -55,6 +55,7 @@ static void d30v_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
 static int d30v_adjust_cost PARAMS ((rtx, rtx, rtx, int));
 static int d30v_issue_rate PARAMS ((void));
 static bool d30v_rtx_costs PARAMS ((rtx, int, int, int *));
+static tree d30v_build_builtin_va_list PARAMS ((void));
 
 /* Define the information needed to generate branch and scc insns.  This is
    stored from the compare operation.  */
@@ -105,6 +106,9 @@ enum reg_class reg_class_from_letter[256];
 #undef TARGET_ADDRESS_COST
 #define TARGET_ADDRESS_COST hook_int_rtx_0
 
+#undef TARGET_BUILD_BUILTIN_VA_LIST
+#define TARGET_BUILD_BUILTIN_VA_LIST d30v_build_builtin_va_list
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 /* Sometimes certain combinations of command options do not make
@@ -2201,8 +2205,8 @@ d30v_setup_incoming_varargs (cum, mode, type, pretend_size, second_time)
 \f
 /* Create the va_list data type.  */
 
-tree
-d30v_build_va_list ()
+static tree
+d30v_build_builtin_va_list ()
 {
   tree f_arg_ptr, f_arg_num, record, type_decl;
   tree int_type_node;
index 59ba9b7ba5f8b66f245c7c4cf0815779cb8798f0..6c4c0669eb66e810293ff1ba0814c635ade133e9 100644 (file)
@@ -1407,13 +1407,6 @@ typedef struct machine_function GTY(())
   d30v_setup_incoming_varargs (&ARGS_SO_FAR, (int) MODE, TYPE,         \
                               &PRETEND_ARGS_SIZE, SECOND_TIME)
 
-/* Build up the stdarg/varargs va_list type tree, assinging it to NODE.  If not
-   defined, it is assumed that va_list is a void * pointer.  */
-
-#define BUILD_VA_LIST_TYPE(VALIST) \
-  (VALIST) = d30v_build_va_list ()
-
-
 /* Implement the stdarg/varargs va_start macro.  STDARG_P is nonzero if this
    is stdarg.h instead of varargs.h.  VALIST is the tree of the va_list
    variable to initialize.  NEXTARG is the machine independent notion of the
index 33469ccd3efe530d322a74ebf82cb6cfac661ed1..60880b805e2ceb9838c9f4998cd4af34564ebc4e 100644 (file)
@@ -203,7 +203,6 @@ extern rtx ix86_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
 
 #ifdef TREE_CODE
 extern int ix86_return_pops_args (tree, tree, int);
-extern tree ix86_build_va_list (void);
 
 extern int ix86_data_alignment (tree, int);
 extern int ix86_local_alignment (tree, int);
index 25240acc9d7d65e00a3b9738faab258957e20fa7..a5d27fcbde725c8d92c7afbd83364425591c6e38 100644 (file)
@@ -830,7 +830,8 @@ static void x86_output_mi_thunk (FILE *, tree, HOST_WIDE_INT,
 static bool x86_can_output_mi_thunk (tree, HOST_WIDE_INT, HOST_WIDE_INT, tree);
 static void x86_file_start (void);
 static void ix86_reorg (void);
-bool ix86_expand_carry_flag_compare (enum rtx_code, rtx, rtx, rtx*);
+static bool ix86_expand_carry_flag_compare (enum rtx_code, rtx, rtx, rtx*);
+static tree ix86_build_builtin_va_list (void);
 
 struct ix86_address
 {
@@ -1012,6 +1013,9 @@ static void init_ext_80387_constants (void);
 #undef TARGET_MACHINE_DEPENDENT_REORG
 #define TARGET_MACHINE_DEPENDENT_REORG ix86_reorg
 
+#undef TARGET_BUILD_BUILTIN_VA_LIST
+#define TARGET_BUILD_BUILTIN_VA_LIST ix86_build_builtin_va_list
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 /* The svr4 ABI for the i386 says that records and unions are returned
@@ -2825,8 +2829,8 @@ ix86_value_regno (enum machine_mode mode)
 \f
 /* Create the va_list data type.  */
 
-tree
-ix86_build_va_list (void)
+static tree
+ix86_build_builtin_va_list (void)
 {
   tree f_gpr, f_fpr, f_ovf, f_sav, record, type_decl;
 
@@ -9454,9 +9458,9 @@ ix86_expand_setcc (enum rtx_code code, rtx dest)
   return 1; /* DONE */
 }
 
-/* Expand comparison setting or clearing carry flag.  Return true when successful
-   and set pop for the operation.  */
-bool
+/* Expand comparison setting or clearing carry flag.  Return true when
+   successful and set pop for the operation.  */
+static bool
 ix86_expand_carry_flag_compare (enum rtx_code code, rtx op0, rtx op1, rtx *pop)
 {
   enum machine_mode mode =
index 53f9bcba6b2ec76098e9ae9cb438679776f26e68..d6133e9402aa31c680445e67774717aa4ee56e36 100644 (file)
@@ -1828,10 +1828,6 @@ typedef struct ix86_args {
   ix86_setup_incoming_varargs (&(CUM), (MODE), (TYPE), &(PRETEND_SIZE), \
                               (NO_RTL))
 
-/* Define the `__builtin_va_list' type for the ABI.  */
-#define BUILD_VA_LIST_TYPE(VALIST) \
-  ((VALIST) = ix86_build_va_list ())
-
 /* Implement `va_start' for varargs and stdarg.  */
 #define EXPAND_BUILTIN_VA_START(VALIST, NEXTARG) \
   ix86_va_start (VALIST, NEXTARG)
index e29a5cd489502b999b7a155963535dad6de2d17b..74568af66b5cb8e3bd7f44caea1e4bfecaded86e 100644 (file)
@@ -51,9 +51,5 @@ extern rtx i860_va_arg (tree, tree);
 #endif /* TREE_CODE */
 #endif /* RTX_CODE */
 
-#ifdef TREE_CODE
-extern tree i860_build_va_list (void);
-#endif /* TREE_CODE */
-
 extern void tdesc_section (void);
 
index a8585eff404a29ec7475f7e5412894d827b531d5..9946f261c7c288367bf9774bd2c3d72612f28bea 100644 (file)
@@ -1813,8 +1813,8 @@ i860_saveregs (void)
 
    The tree representing the va_list declaration is returned.  */
 
-tree
-i860_build_va_list (void)
+static tree
+i860_build_builtin_va_list (void)
 {
   tree f_gpr, f_fpr, f_mem, f_sav, record, type_decl;
 
@@ -2117,5 +2117,7 @@ i860_init_libfuncs (void)
 #undef TARGET_INIT_LIBFUNCS
 #define TARGET_INIT_LIBFUNCS i860_init_libfuncs
 
-struct gcc_target targetm = TARGET_INITIALIZER;
+#undef TARGET_BUILD_BUILTIN_VA_LIST
+#define TARGET_BUILD_BUILTIN_VA_LIST i860_build_builtin_va_list
 
+struct gcc_target targetm = TARGET_INITIALIZER;
index b5575ec7f1c12217f35cf1a43af890a1c94bbf4a..c600f0276ec8b5d9a3c6f6b119657232e97c686b 100644 (file)
@@ -571,10 +571,6 @@ struct cumulative_args { int ints, floats; };
 #define EXPAND_BUILTIN_SAVEREGS() \
   i860_saveregs()
 
-/* Define the `__builtin_va_list' type for the ABI.  */
-#define BUILD_VA_LIST_TYPE(VALIST) \
-  (VALIST) = i860_build_va_list ()
-
 /* Implement `va_start' for varargs and stdarg.  */
 #define EXPAND_BUILTIN_VA_START(valist, nextarg) \
   i860_va_start (valist, nextarg)
index 5a46c4a841dba43b9c6e5c6a7e038cf73707f5e9..fa7941e935884bd692e5f0c4339e1f4cddb3c1a8 100644 (file)
@@ -82,7 +82,6 @@ extern void i960_function_name_declare PARAMS ((FILE *, const char *, tree));
 extern void i960_function_arg_advance PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int));
 extern int i960_round_align PARAMS ((int, tree));
 extern void i960_setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int));
-extern tree i960_build_va_list PARAMS ((void));
 extern int i960_final_reg_parm_stack_space PARAMS ((int, tree));
 extern int i960_reg_parm_stack_space PARAMS ((tree));
 #endif /* TREE_CODE */
index c1284f48da3eb67603441a0c2c3509cd30ee1637..4d4d23f21d89ba72faa901788a435bd82f3f7330 100644 (file)
@@ -52,6 +52,7 @@ static void i960_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
                                          HOST_WIDE_INT, tree));
 static bool i960_rtx_costs PARAMS ((rtx, int, int, int *));
 static int i960_address_cost PARAMS ((rtx));
+static tree i960_build_builtin_va_list (void);
 
 /* Save the operands last given to a compare for use when we
    generate a scc or bcc insn.  */
@@ -114,6 +115,9 @@ static int ret_label = 0;
 #undef TARGET_ADDRESS_COST
 #define TARGET_ADDRESS_COST i960_address_cost
 
+#undef TARGET_BUILD_BUILTIN_VA_LIST
+#define TARGET_BUILD_BUILTIN_VA_LIST i960_build_builtin_va_list
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 /* Override conflicting target switch options.
@@ -2600,8 +2604,8 @@ i960_setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
 
 /* Define the `__builtin_va_list' type for the ABI.  */
 
-tree
-i960_build_va_list ()
+static tree
+i960_build_builtin_va_list ()
 {
   return build_array_type (unsigned_type_node,
                           build_index_type (size_one_node));
index 767efeb7fced32d4b0fc3aa82c8bc1046c5a7ff0..ad86dba003bd0bcde2a612f581ace9995a9df420 100644 (file)
@@ -817,10 +817,6 @@ enum reg_class { NO_REGS, GLOBAL_REGS, LOCAL_REGS, LOCAL_OR_GLOBAL_REGS,
 #define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \
   i960_setup_incoming_varargs(&CUM,MODE,TYPE,&PRETEND_SIZE,NO_RTL)
 
-/* Define the `__builtin_va_list' type for the ABI.  */
-#define BUILD_VA_LIST_TYPE(VALIST) \
-  (VALIST) = i960_build_va_list ()
-
 /* Implement `va_start' for varargs and stdarg.  */
 #define EXPAND_BUILTIN_VA_START(valist, nextarg) \
   i960_va_start (valist, nextarg)
index f32d0c388c939dd796f61ae354720611d76d3b85..6bc18f3b20d86d7b8540554ce5226a544e278d84 100644 (file)
@@ -589,9 +589,6 @@ typedef struct iq2000_args {
 
 #define STRICT_ARGUMENT_NAMING  1
 
-#define BUILD_VA_LIST_TYPE(VALIST) \
-  (VALIST) = ptr_type_node
-
 #define EXPAND_BUILTIN_VA_START(valist, nextarg) \
   iq2000_va_start (valist, nextarg)
 
index d708bcf5d969fb1ca5dd528fa0bd108f0a05ff3b..ca8f4283b7c050ae3d4f720d51f1190e27e71e04 100644 (file)
@@ -423,12 +423,6 @@ while (0)
 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
   asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
 
-/* Define the `__builtin_va_list' type for the ABI.  On IRIX 6, this
-   type is `char *'.  */
-#undef BUILD_VA_LIST_TYPE
-#define BUILD_VA_LIST_TYPE(VALIST) \
-  (VALIST) = build_pointer_type (char_type_node)
-
 #undef ASM_DECLARE_OBJECT_NAME
 #define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
 
index 2e31138e12757c5e0604bf0bfa1ea88cc98b74b1..73b1bc45572e7544cd9687b33dec7e3a03257af1 100644 (file)
@@ -84,7 +84,6 @@ extern bool mips_pad_arg_upward (enum machine_mode, tree);
 extern bool mips_pad_reg_upward (enum machine_mode, tree);
 extern int mips_setup_incoming_varargs (const CUMULATIVE_ARGS *,
                                        enum machine_mode, tree, int);
-extern tree mips_build_va_list (void);
 extern void mips_va_start (tree, rtx);
 extern struct rtx_def *mips_va_arg (tree, tree);
 
index db087f144a6cfcc61ec7eedab977275e085ecbd5..d85a83d68f2b4ab692ac68145d6d2fdcc2fefc79 100644 (file)
@@ -275,6 +275,7 @@ static int mips_adjust_cost (rtx, rtx, rtx, int);
 static int mips_issue_rate (void);
 static int mips_use_dfa_pipeline_interface (void);
 static void mips_init_libfuncs (void);
+static tree mips_build_builtin_va_list (void);
 
 #if TARGET_IRIX
 static void irix_asm_named_section_1 (const char *, unsigned int,
@@ -792,6 +793,9 @@ const struct mips_cpu_info mips_cpu_info_table[] = {
 #undef TARGET_INIT_LIBFUNCS
 #define TARGET_INIT_LIBFUNCS mips_init_libfuncs
 
+#undef TARGET_BUILD_BUILTIN_VA_LIST
+#define TARGET_BUILD_BUILTIN_VA_LIST mips_build_builtin_va_list
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 /* Return true if RELOC is a valid relocation number and OFFSET can be
@@ -3982,9 +3986,8 @@ mips_setup_incoming_varargs (const CUMULATIVE_ARGS *cum,
      and two offsets, although we could have designed this with two pointers
      and three offsets.  */
 
-
-tree
-mips_build_va_list (void)
+static tree
+mips_build_builtin_va_list (void)
 {
   if (EABI_FLOAT_VARARGS_P)
     {
@@ -4028,7 +4031,15 @@ mips_build_va_list (void)
       return record;
     }
   else
-    return ptr_type_node;
+    {
+#if defined(TARGET_IRIX) && !TARGET_IRIX5
+      /* On IRIX 6, this type is 'char *'.  */
+      return build_pointer_type (char_type_node);
+#else
+      /* Otherwise, we use 'void *'.  */
+      return ptr_type_node;
+#endif
+    }
 }
 
 /* Implement va_start.  */
index 1b51913a0221598ac04d1a2c2b120df488b2531d..a27dae3d40b0300de60b6bf7153df43b8b9b29b1 100644 (file)
@@ -2412,10 +2412,6 @@ typedef struct mips_args {
    : ((LOC) + 15) & ~15)
 
 \f
-/* Define the `__builtin_va_list' type for the ABI.  */
-#define BUILD_VA_LIST_TYPE(VALIST) \
-  (VALIST) = mips_build_va_list ()
-
 /* Implement `va_start' for varargs and stdarg.  */
 #define EXPAND_BUILTIN_VA_START(valist, nextarg) \
   mips_va_start (valist, nextarg)
index 35af1676152fd4306717996315cecf2ea53aac37..2f50d1ef7ba92d64f07240646b8f5e6d3a948c2f 100644 (file)
@@ -166,7 +166,6 @@ extern enum direction function_arg_padding (enum machine_mode, tree);
 extern void optimization_options (int, int);
 extern void rs6000_override_options (const char *);
 extern int direct_return (void);
-extern union tree_node *rs6000_build_va_list (void);
 extern int first_reg_to_save (void);
 extern int first_fp_reg_to_save (void);
 extern rs6000_stack_t *rs6000_stack_info (void);
index 2387ea7d367f3b29f6d521abd271372571641746..94527017ac4ac342d97182ba4fdf78f90b126735 100644 (file)
@@ -350,6 +350,7 @@ static rtx rs6000_spe_function_arg (CUMULATIVE_ARGS *,
 static void setup_incoming_varargs (CUMULATIVE_ARGS *,
                                    enum machine_mode, tree,
                                    int *, int);
+static tree rs6000_build_builtin_va_list (void);
 
 /* Hash table stuff for keeping track of TOC entries.  */
 
@@ -554,6 +555,9 @@ static const char alt_reg_names[][8] =
 #undef TARGET_PRETEND_OUTGOING_VARARGS_NAMED
 #define TARGET_PRETEND_OUTGOING_VARARGS_NAMED hook_bool_CUMULATIVE_ARGS_true
 
+#undef TARGET_BUILD_BUILTIN_VA_LIST
+#define TARGET_BUILD_BUILTIN_VA_LIST rs6000_build_builtin_va_list
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 /* Override command line options.  Mostly we process the processor
@@ -4338,8 +4342,8 @@ setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
 
 /* Create the va_list data type.  */
 
-tree
-rs6000_build_va_list (void)
+static tree
+rs6000_build_builtin_va_list (void)
 {
   tree f_gpr, f_fpr, f_res, f_ovf, f_sav, record, type_decl;
 
index a742f5308fc858a002a660b04cb8713e98de7b82..d2c31099e5d03263e09c906508c453f246af11f0 100644 (file)
@@ -1869,10 +1869,6 @@ typedef struct rs6000_args
    the ABIs at the moment.  For now, only AIX gets fixed.  */
 #define SPLIT_COMPLEX_ARGS (DEFAULT_ABI == ABI_AIX)
 
-/* Define the `__builtin_va_list' type for the ABI.  */
-#define BUILD_VA_LIST_TYPE(VALIST) \
-  (VALIST) = rs6000_build_va_list ()
-
 /* Implement `va_start' for varargs and stdarg.  */
 #define EXPAND_BUILTIN_VA_START(valist, nextarg) \
   rs6000_va_start (valist, nextarg)
index e99de323336bb186dd2ff7017d4c25b4a8fc9cbc..cad75e0abd1e6ef956393b75bf4291ae02fd863c 100644 (file)
@@ -97,7 +97,6 @@ extern int s390_agen_dep_p (rtx, rtx);
 extern int s390_function_arg_pass_by_reference (enum machine_mode, tree);
 extern void s390_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
                                       tree, int);
-extern tree s390_build_va_list (void);
 #ifdef RTX_CODE
 extern rtx s390_function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
 extern void s390_va_start (tree, rtx);
index 63c2208fbebdbf5510e6654fe173f0dcd4951612..9a343a95b3bc3f2c6ef91fa84b3d5e5f3641cee0 100644 (file)
@@ -76,6 +76,7 @@ static bool s390_rtx_costs (rtx, int, int, int *);
 static int s390_address_cost (rtx);
 static void s390_reorg (void);
 static bool s390_valid_pointer_mode (enum machine_mode);
+static tree s390_build_builtin_va_list (void);
 
 #undef  TARGET_ASM_ALIGNED_HI_OP
 #define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
@@ -140,6 +141,9 @@ static bool s390_valid_pointer_mode (enum machine_mode);
 #undef TARGET_VALID_POINTER_MODE
 #define TARGET_VALID_POINTER_MODE s390_valid_pointer_mode
 
+#undef TARGET_BUILD_BUILTIN_VA_LIST
+#define TARGET_BUILD_BUILTIN_VA_LIST s390_build_builtin_va_list
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 extern int reload_completed;
@@ -6107,7 +6111,6 @@ s390_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
             long __fpr;
             void *__overflow_arg_area;
             void *__reg_save_area;
-
         } va_list[1];
 
    where __gpr and __fpr hold the number of general purpose
@@ -6119,8 +6122,8 @@ s390_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
    saves all registers used for argument passing into this
    area if the function uses variable arguments.  */
 
-tree
-s390_build_va_list (void)
+static tree
+s390_build_builtin_va_list (void)
 {
   tree f_gpr, f_fpr, f_ovf, f_sav, record, type_decl;
 
index 1463b5035b642a6368830c744cdc2d937fc7b791..610223a41f44c98761f2b0588481823daf6b9a25 100644 (file)
@@ -750,9 +750,6 @@ CUMULATIVE_ARGS;
 
 /* Implementing the varargs macros.  */
 
-#define BUILD_VA_LIST_TYPE(VALIST) \
-  (VALIST) = s390_build_va_list ()
-
 #define EXPAND_BUILTIN_VA_START(valist, nextarg) \
   s390_va_start (valist, nextarg)
 
index 81501b07d4b2c039bc031f48a8508adc989aa97e..eb2f201040023359b0a427552461131de4bbaf12 100644 (file)
@@ -103,10 +103,6 @@ extern rtx sh_va_arg (tree, tree);
 #endif /* TREE_CODE */
 #endif /* RTX_CODE */
 
-#ifdef TREE_CODE
-extern tree sh_build_va_list (void);
-#endif /* TREE_CODE */
-
 extern const char *output_jump_label_table (void);
 extern int sh_handle_pragma (int (*)(void), void (*)(int), const char *);
 extern struct rtx_def *get_fpscr_rtx (void);
index 4207719dc44d49ba1593f2c3d6b7a04eedac487d..d84a36f42f9d943649d9f812dad935706ad2575e 100644 (file)
@@ -246,6 +246,7 @@ static rtx sh_builtin_saveregs (void);
 static void sh_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int);
 static bool sh_strict_argument_naming (CUMULATIVE_ARGS *);
 static bool sh_pretend_outgoing_varargs_named (CUMULATIVE_ARGS *);
+static tree sh_build_builtin_va_list (void);
 
 \f
 /* Initialize the GCC target structure.  */
@@ -345,6 +346,9 @@ static bool sh_pretend_outgoing_varargs_named (CUMULATIVE_ARGS *);
 #undef TARGET_PRETEND_OUTGOING_VARARGS_NAMED
 #define TARGET_PRETEND_OUTGOING_VARARGS_NAMED sh_pretend_outgoing_varargs_named
 
+#undef TARGET_BUILD_BUILTIN_VA_LIST
+#define TARGET_BUILD_BUILTIN_VA_LIST sh_build_builtin_va_list
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 /* Print the operand address in x to the stream.  */
@@ -5911,8 +5915,8 @@ sh_builtin_saveregs (void)
 
 /* Define the `__builtin_va_list' type for the ABI.  */
 
-tree
-sh_build_va_list (void)
+static tree
+sh_build_builtin_va_list (void)
 {
   tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack;
   tree record;
index 4ccff4b35310be3f0317d76bec1af01b6bbe3c75..907e7652593bc0c87b2d8b165686b1198c5ddb5d 100644 (file)
@@ -2033,10 +2033,6 @@ struct sh_args {
 /* Perform any needed actions needed for a function that is receiving a
    variable number of arguments.  */
 
-/* Define the `__builtin_va_list' type for the ABI.  */
-#define BUILD_VA_LIST_TYPE(VALIST) \
-  (VALIST) = sh_build_va_list ()
-
 /* Implement `va_start' for varargs and stdarg.  */
 #define EXPAND_BUILTIN_VA_START(valist, nextarg) \
   sh_va_start (valist, nextarg)
index 9c37c41799168541a649b86d3dba7457b03f59af..0d6d45f1640927dd1e36b6bfd724c909b4cb8339 100644 (file)
@@ -96,7 +96,6 @@ extern int a7_overlap_mentioned_p (rtx);
 extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree);
 extern struct rtx_def *function_arg (CUMULATIVE_ARGS *, enum machine_mode,
                                     tree, int);
-extern tree xtensa_build_va_list (void);
 #endif /* TREE_CODE */
 
 extern int xtensa_mask_immediate (int);
index 23798b0019195ddc07b330ba2820230459d38389..2e69c46f7140cf70dc884ee653c6a4209a97e79d 100644 (file)
@@ -205,6 +205,7 @@ static unsigned int xtensa_multibss_section_type_flags (tree, const char *,
 static void xtensa_select_rtx_section (enum machine_mode, rtx,
                                       unsigned HOST_WIDE_INT);
 static bool xtensa_rtx_costs (rtx, int, int, int *);
+static tree xtensa_build_builtin_va_list (void);
 
 static int current_function_arg_words;
 static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] =
@@ -233,6 +234,9 @@ static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] =
 #undef TARGET_ADDRESS_COST
 #define TARGET_ADDRESS_COST hook_int_rtx_0
 
+#undef TARGET_BUILD_BUILTIN_VA_LIST
+#define TARGET_BUILD_BUILTIN_VA_LIST xtensa_build_builtin_va_list
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 
@@ -2318,8 +2322,8 @@ xtensa_return_addr (int count, rtx frame)
    references argument word N for 0 <= N < 6, and __va_stk[N*4] references
    argument word N for N >= 6.  */
 
-tree
-xtensa_build_va_list (void)
+static tree
+xtensa_build_builtin_va_list (void)
 {
   tree f_stk, f_reg, f_ndx, record, type_decl;
 
index 621dd5fbbb67740262474bdf4e48384791cea4e0..dae6810ea008b64cf736b20c958db16569014d8b 100644 (file)
@@ -930,10 +930,6 @@ typedef struct xtensa_args {
                       0, VOIDmode, 1, addr, Pmode);                    \
   } while (0)
 
-/* Define the `__builtin_va_list' type for the ABI.  */
-#define BUILD_VA_LIST_TYPE(VALIST) \
-  (VALIST) = xtensa_build_va_list ()
-
 /* If defined, is a C expression that produces the machine-specific
    code for a call to '__builtin_saveregs'.  This code will be moved
    to the very beginning of the function, before any parameter access
index 0070c6d7586edee0e902e11a73b99107290f1cbe..7b0c6b84846bc3d93775c868fc2d6fb14829b7de 100644 (file)
@@ -382,10 +382,6 @@ do { fputs (integer_asm_op (POINTER_SIZE / UNITS_PER_WORD, TRUE), FILE); \
 #define POINTER_SIZE BITS_PER_WORD
 #endif
 
-#ifndef BUILD_VA_LIST_TYPE
-#define BUILD_VA_LIST_TYPE(X) ((X) = ptr_type_node)
-#endif
-
 #ifndef PIC_OFFSET_TABLE_REGNUM
 #define PIC_OFFSET_TABLE_REGNUM INVALID_REGNUM
 #endif
index c598ff7193ae769ee0e539b5f0de8a2be3739d90..abd7f5b049de007d61cf2d59da6878a8927e47d7 100644 (file)
@@ -331,6 +331,7 @@ extern rtx gen_cond_trap (enum rtx_code, rtx, rtx, rtx);
 \f
 /* Functions from builtins.c:  */
 extern rtx expand_builtin (tree, rtx, rtx, enum machine_mode, int);
+extern tree std_build_builtin_va_list (void);
 extern void std_expand_builtin_va_start (tree, rtx);
 extern rtx std_expand_builtin_va_arg (tree, tree);
 extern rtx expand_builtin_va_arg (tree, tree);
index d0a9eab00db665d1a3602d9e73192c19ac1b76f5..a00c0d37d42e52f79ceebd702dd12961ad59e489 100644 (file)
@@ -594,7 +594,7 @@ typedef char _Bool;
        ASM_SIMPLIFY_DWARF_ADDR INIT_TARGET_OPTABS INIT_SUBTARGET_OPTABS \
        INIT_GOFAST_OPTABS MULSI3_LIBCALL MULDI3_LIBCALL DIVSI3_LIBCALL \
        DIVDI3_LIBCALL UDIVSI3_LIBCALL UDIVDI3_LIBCALL MODSI3_LIBCALL   \
-       MODDI3_LIBCALL UMODSI3_LIBCALL UMODDI3_LIBCALL
+       MODDI3_LIBCALL UMODSI3_LIBCALL UMODDI3_LIBCALL BUILD_VA_LIST_TYPE
 
 /* Other obsolete target macros, or macros that used to be in target
    headers and were not used, and may be obsolete or may never have
index 5c7fcb0b9df025276593f954e3f8da9500df492e..4d091f2160234004803da54e55c1a635a9a7b0a7 100644 (file)
@@ -316,6 +316,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 #define TARGET_MACHINE_DEPENDENT_REORG 0
 
+#define TARGET_BUILD_BUILTIN_VA_LIST std_build_builtin_va_list
+
 #define TARGET_GET_PCH_VALIDITY default_get_pch_validity
 #define TARGET_PCH_VALID_P default_pch_valid_p
 
@@ -377,6 +379,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   TARGET_ADDRESS_COST,                         \
   TARGET_DWARF_REGISTER_SPAN,                   \
   TARGET_MACHINE_DEPENDENT_REORG,              \
+  TARGET_BUILD_BUILTIN_VA_LIST,                        \
   TARGET_GET_PCH_VALIDITY,                     \
   TARGET_PCH_VALID_P,                          \
   TARGET_HAVE_NAMED_SECTIONS,                  \
index 0b19445456aa4de01a7685249a7c2942acd49c12..c77d40f5fafdce1a2e30fa1569285418d9cba430 100644 (file)
@@ -382,6 +382,9 @@ struct gcc_target
      delayed-branch scheduling.  */
   void (* machine_dependent_reorg) (void);
 
+  /* Create the __builtin_va_list type.  */
+  tree (* build_builtin_va_list) (void);
+
   /* Validity-checking routines for PCH files, target-specific.
      get_pch_validity returns a pointer to the data to be stored,
      and stores the size in its argument.  pch_valid_p gets the same
index 7d0258c1fa02090bbe4f66710e58965f7d5ee202..66e0afd735130f1625eff24a8ae38ef9ca747efd 100644 (file)
@@ -4916,8 +4916,7 @@ build_common_tree_nodes_2 (int short_double)
   layout_type (complex_long_double_type_node);
 
   {
-    tree t;
-    BUILD_VA_LIST_TYPE (t);
+    tree t = (*targetm.build_builtin_va_list) ();
 
     /* Many back-ends define record types without setting TYPE_NAME.
        If we copied the record type here, we'd keep the original