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]

Hookize BUILD_VA_LIST_TYPE


Part 1 of 3 to hookize the stdarg target macros.  Applied to mainline
to minimize tree-ssa divergence.

Tested via bootstrap on alpha-linux and building cc1 on

d30v-elf
i386-elf
i860-svr4
i960-coff
mips-sgi-irix6
powerpc-eabi
s390-linux
sh-elf
xtensa-elf


r~


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

Index: gcc/builtins.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/builtins.c,v
retrieving revision 1.260
diff -c -p -d -u -r1.260 builtins.c
--- gcc/builtins.c	16 Oct 2003 02:36:48 -0000	1.260
+++ gcc/builtins.c	30 Oct 2003 01:51:10 -0000
@@ -3910,6 +3910,14 @@ stabilize_va_list (tree valist, int need
   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: gcc/defaults.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/defaults.h,v
retrieving revision 1.117
diff -c -p -d -u -r1.117 defaults.h
--- gcc/defaults.h	13 Oct 2003 21:16:18 -0000	1.117
+++ gcc/defaults.h	30 Oct 2003 01:51:10 -0000
@@ -382,10 +382,6 @@ do { fputs (integer_asm_op (POINTER_SIZE
 #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: gcc/expr.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.h,v
retrieving revision 1.149
diff -c -p -d -u -r1.149 expr.h
--- gcc/expr.h	2 Oct 2003 00:44:13 -0000	1.149
+++ gcc/expr.h	30 Oct 2003 01:51:10 -0000
@@ -331,6 +331,7 @@ extern rtx gen_cond_trap (enum rtx_code,
 
 /* 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: gcc/system.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/system.h,v
retrieving revision 1.171
diff -c -p -d -u -r1.171 system.h
--- gcc/system.h	16 Oct 2003 18:05:57 -0000	1.171
+++ gcc/system.h	30 Oct 2003 01:51:10 -0000
@@ -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: gcc/target-def.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/target-def.h,v
retrieving revision 1.59
diff -c -p -d -u -r1.59 target-def.h
--- gcc/target-def.h	24 Oct 2003 21:28:09 -0000	1.59
+++ gcc/target-def.h	30 Oct 2003 01:51:10 -0000
@@ -316,6 +316,8 @@ Foundation, 59 Temple Place - Suite 330,
 
 #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,
   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: gcc/target.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/target.h,v
retrieving revision 1.67
diff -c -p -d -u -r1.67 target.h
--- gcc/target.h	24 Oct 2003 21:28:09 -0000	1.67
+++ gcc/target.h	30 Oct 2003 01:51:10 -0000
@@ -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: gcc/tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.c,v
retrieving revision 1.336
diff -c -p -d -u -r1.336 tree.c
--- gcc/tree.c	22 Oct 2003 02:19:38 -0000	1.336
+++ gcc/tree.c	30 Oct 2003 01:51:11 -0000
@@ -4916,8 +4916,7 @@ build_common_tree_nodes_2 (int short_dou
   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
Index: gcc/config/alpha/alpha-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha-protos.h,v
retrieving revision 1.53
diff -c -p -d -u -r1.53 alpha-protos.h
--- gcc/config/alpha/alpha-protos.h	20 Oct 2003 16:06:55 -0000	1.53
+++ gcc/config/alpha/alpha-protos.h	30 Oct 2003 01:51:11 -0000
@@ -80,7 +80,6 @@ extern void print_operand (FILE *, rtx, 
 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: gcc/config/alpha/alpha.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.c,v
retrieving revision 1.336
diff -c -p -d -u -r1.336 alpha.c
--- gcc/config/alpha/alpha.c	27 Oct 2003 06:49:39 -0000	1.336
+++ gcc/config/alpha/alpha.c	30 Oct 2003 01:51:11 -0000
@@ -6080,8 +6080,8 @@ function_value (tree valtype, tree func 
   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;
 
@@ -10187,6 +10187,9 @@ alpha_init_libfuncs (void)
 #define TARGET_STRICT_ARGUMENT_NAMING hook_bool_CUMULATIVE_ARGS_true
 #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;
 
Index: gcc/config/alpha/alpha.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.h,v
retrieving revision 1.209
diff -c -p -d -u -r1.209 alpha.h
--- gcc/config/alpha/alpha.h	20 Oct 2003 16:06:55 -0000	1.209
+++ gcc/config/alpha/alpha.h	30 Oct 2003 01:51:11 -0000
@@ -1679,10 +1679,6 @@ do {						\
   {"some_small_symbolic_operand", {SET, PARALLEL, PREFETCH, UNSPEC,	\
 				   UNSPEC_VOLATILE}},
 
-/* 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: gcc/config/alpha/unicosmk.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/unicosmk.h,v
retrieving revision 1.25
diff -c -p -d -u -r1.25 unicosmk.h
--- gcc/config/alpha/unicosmk.h	11 Oct 2003 16:54:17 -0000	1.25
+++ gcc/config/alpha/unicosmk.h	30 Oct 2003 01:51:11 -0000
@@ -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: gcc/config/d30v/d30v-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/d30v/d30v-protos.h,v
retrieving revision 1.12
diff -c -p -d -u -r1.12 d30v-protos.h
--- gcc/config/d30v/d30v-protos.h	27 Sep 2003 04:48:14 -0000	1.12
+++ gcc/config/d30v/d30v-protos.h	30 Oct 2003 01:51:11 -0000
@@ -103,7 +103,6 @@ extern rtx d30v_expand_builtin_saveregs	
 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: gcc/config/d30v/d30v.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/d30v/d30v.c,v
retrieving revision 1.32
diff -c -p -d -u -r1.32 d30v.c
--- gcc/config/d30v/d30v.c	17 Jun 2003 19:03:10 -0000	1.32
+++ gcc/config/d30v/d30v.c	30 Oct 2003 01:51:11 -0000
@@ -55,6 +55,7 @@ static void d30v_output_function_epilogu
 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;
 
 /* Sometimes certain combinations of command options do not make
@@ -2201,8 +2205,8 @@ d30v_setup_incoming_varargs (cum, mode, 
 
 /* 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: gcc/config/d30v/d30v.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/d30v/d30v.h,v
retrieving revision 1.86
diff -c -p -d -u -r1.86 d30v.h
--- gcc/config/d30v/d30v.h	27 Sep 2003 04:48:14 -0000	1.86
+++ gcc/config/d30v/d30v.h	30 Oct 2003 01:51:11 -0000
@@ -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: gcc/config/i386/i386-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386-protos.h,v
retrieving revision 1.101
diff -c -p -d -u -r1.101 i386-protos.h
--- gcc/config/i386/i386-protos.h	26 Sep 2003 03:46:05 -0000	1.101
+++ gcc/config/i386/i386-protos.h	30 Oct 2003 01:51:11 -0000
@@ -203,7 +203,6 @@ extern rtx ix86_expand_builtin (tree, rt
 
 #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: gcc/config/i386/i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.613
diff -c -p -d -u -r1.613 i386.c
--- gcc/config/i386/i386.c	27 Oct 2003 10:52:46 -0000	1.613
+++ gcc/config/i386/i386.c	30 Oct 2003 01:51:12 -0000
@@ -830,7 +830,8 @@ static void x86_output_mi_thunk (FILE *,
 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 (vo
 #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;
 
 /* The svr4 ABI for the i386 says that records and unions are returned
@@ -2825,8 +2829,8 @@ ix86_value_regno (enum machine_mode mode
 
 /* 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, r
   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: gcc/config/i386/i386.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.h,v
retrieving revision 1.355
diff -c -p -d -u -r1.355 i386.h
--- gcc/config/i386/i386.h	20 Oct 2003 18:32:51 -0000	1.355
+++ gcc/config/i386/i386.h	30 Oct 2003 01:51:12 -0000
@@ -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: gcc/config/i860/i860-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i860/i860-protos.h,v
retrieving revision 1.7
diff -c -p -d -u -r1.7 i860-protos.h
--- gcc/config/i860/i860-protos.h	23 Aug 2003 02:30:35 -0000	1.7
+++ gcc/config/i860/i860-protos.h	30 Oct 2003 01:51:12 -0000
@@ -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: gcc/config/i860/i860.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i860/i860.c,v
retrieving revision 1.39
diff -c -p -d -u -r1.39 i860.c
--- gcc/config/i860/i860.c	2 Oct 2003 00:44:21 -0000	1.39
+++ gcc/config/i860/i860.c	30 Oct 2003 01:51:12 -0000
@@ -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: gcc/config/i860/i860.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i860/i860.h,v
retrieving revision 1.38
diff -c -p -d -u -r1.38 i860.h
--- gcc/config/i860/i860.h	13 Oct 2003 21:16:27 -0000	1.38
+++ gcc/config/i860/i860.h	30 Oct 2003 01:51:12 -0000
@@ -571,10 +571,6 @@ struct cumulative_args { int ints, float
 #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: gcc/config/i960/i960-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i960/i960-protos.h,v
retrieving revision 1.13
diff -c -p -d -u -r1.13 i960-protos.h
--- gcc/config/i960/i960-protos.h	27 Sep 2003 04:48:19 -0000	1.13
+++ gcc/config/i960/i960-protos.h	30 Oct 2003 01:51:12 -0000
@@ -82,7 +82,6 @@ extern void i960_function_name_declare P
 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: gcc/config/i960/i960.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i960/i960.c,v
retrieving revision 1.58
diff -c -p -d -u -r1.58 i960.c
--- gcc/config/i960/i960.c	13 Oct 2003 21:16:27 -0000	1.58
+++ gcc/config/i960/i960.c	30 Oct 2003 01:51:13 -0000
@@ -52,6 +52,7 @@ static void i960_output_mi_thunk PARAMS 
 					  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;
 
 /* Override conflicting target switch options.
@@ -2600,8 +2604,8 @@ i960_setup_incoming_varargs (cum, mode, 
 
 /* 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: gcc/config/i960/i960.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i960/i960.h,v
retrieving revision 1.82
diff -c -p -d -u -r1.82 i960.h
--- gcc/config/i960/i960.h	27 Sep 2003 04:48:19 -0000	1.82
+++ gcc/config/i960/i960.h	30 Oct 2003 01:51:13 -0000
@@ -817,10 +817,6 @@ enum reg_class { NO_REGS, GLOBAL_REGS, L
 #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: gcc/config/iq2000/iq2000.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/iq2000/iq2000.h,v
retrieving revision 1.6
diff -c -p -d -u -r1.6 iq2000.h
--- gcc/config/iq2000/iq2000.h	10 Oct 2003 20:33:07 -0000	1.6
+++ gcc/config/iq2000/iq2000.h	30 Oct 2003 01:51:13 -0000
@@ -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: gcc/config/mips/iris6.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/iris6.h,v
retrieving revision 1.71
diff -c -p -d -u -r1.71 iris6.h
--- gcc/config/mips/iris6.h	17 Oct 2003 11:44:32 -0000	1.71
+++ gcc/config/mips/iris6.h	30 Oct 2003 01:51:13 -0000
@@ -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: gcc/config/mips/mips-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips-protos.h,v
retrieving revision 1.54
diff -c -p -d -u -r1.54 mips-protos.h
--- gcc/config/mips/mips-protos.h	17 Oct 2003 11:44:32 -0000	1.54
+++ gcc/config/mips/mips-protos.h	30 Oct 2003 01:51:13 -0000
@@ -84,7 +84,6 @@ extern bool mips_pad_arg_upward (enum ma
 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: gcc/config/mips/mips.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.c,v
retrieving revision 1.336
diff -c -p -d -u -r1.336 mips.c
--- gcc/config/mips/mips.c	19 Oct 2003 07:52:10 -0000	1.336
+++ gcc/config/mips/mips.c	30 Oct 2003 01:51:13 -0000
@@ -275,6 +275,7 @@ static int mips_adjust_cost (rtx, rtx, r
 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
 #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;
 
 /* Return true if RELOC is a valid relocation number and OFFSET can be
@@ -3982,9 +3986,8 @@ mips_setup_incoming_varargs (const CUMUL
      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: gcc/config/mips/mips.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.h,v
retrieving revision 1.302
diff -c -p -d -u -r1.302 mips.h
--- gcc/config/mips/mips.h	20 Oct 2003 18:37:17 -0000	1.302
+++ gcc/config/mips/mips.h	30 Oct 2003 01:51:13 -0000
@@ -2412,10 +2412,6 @@ typedef struct mips_args {
    : ((LOC) + 15) & ~15)
 
 
-/* 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: gcc/config/rs6000/rs6000-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000-protos.h,v
retrieving revision 1.64
diff -c -p -d -u -r1.64 rs6000-protos.h
--- gcc/config/rs6000/rs6000-protos.h	7 Oct 2003 19:23:07 -0000	1.64
+++ gcc/config/rs6000/rs6000-protos.h	30 Oct 2003 01:51:13 -0000
@@ -166,7 +166,6 @@ extern enum direction function_arg_paddi
 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: gcc/config/rs6000/rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.536
diff -c -p -d -u -r1.536 rs6000.c
--- gcc/config/rs6000/rs6000.c	23 Oct 2003 14:36:23 -0000	1.536
+++ gcc/config/rs6000/rs6000.c	30 Oct 2003 01:51:14 -0000
@@ -350,6 +350,7 @@ static rtx rs6000_spe_function_arg (CUMU
 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;
 
 /* Override command line options.  Mostly we process the processor
@@ -4338,8 +4342,8 @@ setup_incoming_varargs (CUMULATIVE_ARGS 
 
 /* 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: gcc/config/rs6000/rs6000.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.h,v
retrieving revision 1.293
diff -c -p -d -u -r1.293 rs6000.h
--- gcc/config/rs6000/rs6000.h	29 Oct 2003 21:02:14 -0000	1.293
+++ gcc/config/rs6000/rs6000.h	30 Oct 2003 01:51:14 -0000
@@ -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: gcc/config/s390/s390-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390-protos.h,v
retrieving revision 1.38
diff -c -p -d -u -r1.38 s390-protos.h
--- gcc/config/s390/s390-protos.h	18 Oct 2003 22:24:37 -0000	1.38
+++ gcc/config/s390/s390-protos.h	30 Oct 2003 01:51:14 -0000
@@ -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: gcc/config/s390/s390.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.c,v
retrieving revision 1.118
diff -c -p -d -u -r1.118 s390.c
--- gcc/config/s390/s390.c	24 Oct 2003 17:30:34 -0000	1.118
+++ gcc/config/s390/s390.c	30 Oct 2003 01:51:15 -0000
@@ -76,6 +76,7 @@ static bool s390_rtx_costs (rtx, int, in
 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 (enu
 #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,
             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,
    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: gcc/config/s390/s390.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.h,v
retrieving revision 1.88
diff -c -p -d -u -r1.88 s390.h
--- gcc/config/s390/s390.h	18 Oct 2003 22:24:37 -0000	1.88
+++ gcc/config/s390/s390.h	30 Oct 2003 01:51:15 -0000
@@ -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: gcc/config/sh/sh-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh-protos.h,v
retrieving revision 1.48
diff -c -p -d -u -r1.48 sh-protos.h
--- gcc/config/sh/sh-protos.h	13 Oct 2003 08:44:08 -0000	1.48
+++ gcc/config/sh/sh-protos.h	30 Oct 2003 01:51:15 -0000
@@ -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: gcc/config/sh/sh.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.c,v
retrieving revision 1.237
diff -c -p -d -u -r1.237 sh.c
--- gcc/config/sh/sh.c	13 Oct 2003 08:44:05 -0000	1.237
+++ gcc/config/sh/sh.c	30 Oct 2003 01:51:15 -0000
@@ -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);
 
 
 /* Initialize the GCC target structure.  */
@@ -345,6 +346,9 @@ static bool sh_pretend_outgoing_varargs_
 #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;
 
 /* 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: gcc/config/sh/sh.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.h,v
retrieving revision 1.225
diff -c -p -d -u -r1.225 sh.h
--- gcc/config/sh/sh.h	13 Oct 2003 21:16:32 -0000	1.225
+++ gcc/config/sh/sh.h	30 Oct 2003 01:51:15 -0000
@@ -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: gcc/config/xtensa/xtensa-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/xtensa/xtensa-protos.h,v
retrieving revision 1.12
diff -c -p -d -u -r1.12 xtensa-protos.h
--- gcc/config/xtensa/xtensa-protos.h	22 Sep 2003 23:19:45 -0000	1.12
+++ gcc/config/xtensa/xtensa-protos.h	30 Oct 2003 01:51:15 -0000
@@ -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: gcc/config/xtensa/xtensa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/xtensa/xtensa.c,v
retrieving revision 1.40
diff -c -p -d -u -r1.40 xtensa.c
--- gcc/config/xtensa/xtensa.c	9 Oct 2003 20:21:11 -0000	1.40
+++ gcc/config/xtensa/xtensa.c	30 Oct 2003 01:51:15 -0000
@@ -205,6 +205,7 @@ static unsigned int xtensa_multibss_sect
 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
 #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;
 
 
@@ -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: gcc/config/xtensa/xtensa.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/xtensa/xtensa.h,v
retrieving revision 1.41
diff -c -p -d -u -r1.41 xtensa.h
--- gcc/config/xtensa/xtensa.h	15 Sep 2003 23:02:31 -0000	1.41
+++ gcc/config/xtensa/xtensa.h	30 Oct 2003 01:51:15 -0000
@@ -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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]