[patch] i386: Hookize SETUP_INCOMING_VARARGS.

Kazu Hirata kazu@cs.umass.edu
Sat Jan 31 06:19:00 GMT 2004


Hi,

Attached is a patch to hookize SETUP_INCOMING_VARARGS.

Bootstrapped on i686-pc-linux-gnu.  OK to apply?

Kazu Hirata

2004-01-30  Kazu Hirata  <kazu@cs.umass.edu>

	* config/i386/i386-protos.h: Remove the prototype for
	ix86_setup_incoming_varargs.
	* config/i386/i386.c (TARGET_SETUP_INCOMING_VARARGS): New.
	(ix86_setup_incoming_varargs): Make it static.
	* config/i386/i386.h (SETUP_INCOMING_VARARGS): Remove.

Index: i386-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386-protos.h,v
retrieving revision 1.105
diff -c -r1.105 i386-protos.h
*** i386-protos.h	29 Jan 2004 08:05:44 -0000	1.105
--- i386-protos.h	30 Jan 2004 23:31:41 -0000
***************
*** 165,172 ****
  extern int ix86_return_in_memory (tree);
  extern void ix86_va_start (tree, rtx);
  extern rtx ix86_va_arg (tree, tree);
- extern void ix86_setup_incoming_varargs (CUMULATIVE_ARGS *,
- 					 enum machine_mode, tree, int *, int);
  
  extern rtx ix86_force_to_memory (enum machine_mode, rtx);
  extern void ix86_free_from_memory (enum machine_mode);
--- 165,170 ----
Index: i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.640
diff -c -r1.640 i386.c
*** i386.c	29 Jan 2004 08:05:44 -0000	1.640
--- i386.c	30 Jan 2004 23:31:47 -0000
***************
*** 834,839 ****
--- 834,841 ----
  static void ix86_reorg (void);
  static bool ix86_expand_carry_flag_compare (enum rtx_code, rtx, rtx, rtx*);
  static tree ix86_build_builtin_va_list (void);
+ static void ix86_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode,
+ 					 tree, int *, int);
  
  struct ix86_address
  {
***************
*** 1029,1034 ****
--- 1031,1039 ----
  #undef TARGET_STRUCT_VALUE_RTX
  #define TARGET_STRUCT_VALUE_RTX hook_rtx_tree_int_null
  
+ #undef TARGET_SETUP_INCOMING_VARARGS
+ #define TARGET_SETUP_INCOMING_VARARGS ix86_setup_incoming_varargs
+ 
  struct gcc_target targetm = TARGET_INITIALIZER;
  
  /* The svr4 ABI for the i386 says that records and unions are returned
***************
*** 2947,2967 ****
    return build_array_type (record, build_index_type (size_zero_node));
  }
  
! /* Perform any needed actions needed for a function that is receiving a
!    variable number of arguments.
! 
!    CUM is as above.
! 
!    MODE and TYPE are the mode and type of the current parameter.
  
!    PRETEND_SIZE is a variable that should be set to the amount of stack
!    that must be pushed by the prolog to pretend that our caller pushed
!    it.
! 
!    Normally, this macro will push all remaining incoming registers on the
!    stack and set PRETEND_SIZE to the length of the registers pushed.  */
! 
! void
  ix86_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
  			     tree type, int *pretend_size ATTRIBUTE_UNUSED,
  			     int no_rtl)
--- 2952,2960 ----
    return build_array_type (record, build_index_type (size_zero_node));
  }
  
! /* Worker function for TARGET_SETUP_INCOMING_VARARGS.  */
  
! static void
  ix86_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
  			     tree type, int *pretend_size ATTRIBUTE_UNUSED,
  			     int no_rtl)
Index: i386.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.h,v
retrieving revision 1.369
diff -c -r1.369 i386.h
*** i386.h	28 Jan 2004 05:12:22 -0000	1.369
--- i386.h	30 Jan 2004 23:31:49 -0000
***************
*** 1788,1811 ****
  #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \
    function_arg_pass_by_reference(&CUM, MODE, TYPE, NAMED)
   
- /* Perform any needed actions needed for a function that is receiving a
-    variable number of arguments.
- 
-    CUM is as above.
- 
-    MODE and TYPE are the mode and type of the current parameter.
- 
-    PRETEND_SIZE is a variable that should be set to the amount of stack
-    that must be pushed by the prolog to pretend that our caller pushed
-    it.
- 
-    Normally, this macro will push all remaining incoming registers on the
-    stack and set PRETEND_SIZE to the length of the registers pushed.  */
- 
- #define SETUP_INCOMING_VARARGS(CUM, MODE, TYPE, PRETEND_SIZE, NO_RTL)	\
-   ix86_setup_incoming_varargs (&(CUM), (MODE), (TYPE), &(PRETEND_SIZE), \
- 			       (NO_RTL))
- 
  /* Implement `va_start' for varargs and stdarg.  */
  #define EXPAND_BUILTIN_VA_START(VALIST, NEXTARG) \
    ix86_va_start (VALIST, NEXTARG)
--- 1788,1793 ----



More information about the Gcc-patches mailing list