Remove TARGET_SETUP_INCOMING_VARARG_BOUNDS
diff mbox series

Message ID mpt36i2h7zh.fsf@arm.com
State New
Headers show
Series
  • Remove TARGET_SETUP_INCOMING_VARARG_BOUNDS
Related show

Commit Message

Richard Sandiford Aug. 15, 2019, 1:29 p.m. UTC
TARGET_SETUP_INCOMING_VARARG_BOUNDS seems to be an unused vestige of the
MPX support.

Tested on aarch64-linux-gnu and x86_64-linux-gnu.  OK to install?

Richard


2019-08-15  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* target.def (setup_incoming_vararg_bounds): Remove.
	* doc/tm.texi (TARGET_SETUP_INCOMING_VARARG_BOUNDS): Remove.
	* doc/tm.texi.in: Regenerate.
	* targhooks.c (default_setup_incoming_vararg_bounds): Delete.
	* targhooks.h (default_setup_incoming_vararg_bounds): Likewise.
	* config/i386/i386.c (ix86_setup_incoming_vararg_bounds): Likewise.
	(TARGET_SETUP_INCOMING_VARARG_BOUNDS): Likewise.

Comments

Richard Biener Aug. 15, 2019, 2:16 p.m. UTC | #1
On Thu, Aug 15, 2019 at 3:30 PM Richard Sandiford
<richard.sandiford@arm.com> wrote:
>
> TARGET_SETUP_INCOMING_VARARG_BOUNDS seems to be an unused vestige of the
> MPX support.
>
> Tested on aarch64-linux-gnu and x86_64-linux-gnu.  OK to install?

OK.

> Richard
>
>
> 2019-08-15  Richard Sandiford  <richard.sandiford@arm.com>
>
> gcc/
>         * target.def (setup_incoming_vararg_bounds): Remove.
>         * doc/tm.texi (TARGET_SETUP_INCOMING_VARARG_BOUNDS): Remove.
>         * doc/tm.texi.in: Regenerate.
>         * targhooks.c (default_setup_incoming_vararg_bounds): Delete.
>         * targhooks.h (default_setup_incoming_vararg_bounds): Likewise.
>         * config/i386/i386.c (ix86_setup_incoming_vararg_bounds): Likewise.
>         (TARGET_SETUP_INCOMING_VARARG_BOUNDS): Likewise.
>
> Index: gcc/target.def
> ===================================================================
> --- gcc/target.def      2019-08-13 22:33:30.929994105 +0100
> +++ gcc/target.def      2019-08-15 14:28:02.041548275 +0100
> @@ -4551,15 +4551,6 @@ returned by function call into @var{slot
>   default_store_returned_bounds)
>
>  DEFHOOK
> -(setup_incoming_vararg_bounds,
> - "Use it to store bounds for anonymous register arguments stored\n\
> -into the stack.  Arguments meaning is similar to\n\
> -@code{TARGET_SETUP_INCOMING_VARARGS}.",
> - void, (cumulative_args_t args_so_far, machine_mode mode, tree type,
> -       int *pretend_args_size, int second_time),
> - default_setup_incoming_vararg_bounds)
> -
> -DEFHOOK
>  (call_args,
>   "While generating RTL for a function call, this target hook is invoked once\n\
>  for each argument passed to the function, either a register returned by\n\
> Index: gcc/doc/tm.texi
> ===================================================================
> --- gcc/doc/tm.texi     2019-08-13 22:33:30.801995048 +0100
> +++ gcc/doc/tm.texi     2019-08-15 14:28:02.041548275 +0100
> @@ -5314,12 +5314,6 @@ This hook is used by expand pass to emit
>  returned by function call into @var{slot}.
>  @end deftypefn
>
> -@deftypefn {Target Hook} void TARGET_SETUP_INCOMING_VARARG_BOUNDS (cumulative_args_t @var{args_so_far}, machine_mode @var{mode}, tree @var{type}, int *@var{pretend_args_size}, int @var{second_time})
> -Use it to store bounds for anonymous register arguments stored
> -into the stack.  Arguments meaning is similar to
> -@code{TARGET_SETUP_INCOMING_VARARGS}.
> -@end deftypefn
> -
>  @node Trampolines
>  @section Support for Nested Functions
>  @cindex support for nested functions
> Index: gcc/doc/tm.texi.in
> ===================================================================
> --- gcc/doc/tm.texi.in  2019-06-18 09:35:52.089892867 +0100
> +++ gcc/doc/tm.texi.in  2019-08-15 14:28:02.041548275 +0100
> @@ -3785,8 +3785,6 @@ These machine description macros help im
>
>  @hook TARGET_STORE_RETURNED_BOUNDS
>
> -@hook TARGET_SETUP_INCOMING_VARARG_BOUNDS
> -
>  @node Trampolines
>  @section Support for Nested Functions
>  @cindex support for nested functions
> Index: gcc/targhooks.c
> ===================================================================
> --- gcc/targhooks.c     2019-07-10 19:41:20.127948228 +0100
> +++ gcc/targhooks.c     2019-08-15 14:28:02.041548275 +0100
> @@ -2274,15 +2274,6 @@ std_gimplify_va_arg_expr (tree valist, t
>    return build_va_arg_indirect_ref (addr);
>  }
>
> -void
> -default_setup_incoming_vararg_bounds (cumulative_args_t ca ATTRIBUTE_UNUSED,
> -                                     machine_mode mode ATTRIBUTE_UNUSED,
> -                                     tree type ATTRIBUTE_UNUSED,
> -                                     int *pretend_arg_size ATTRIBUTE_UNUSED,
> -                                     int second_time ATTRIBUTE_UNUSED)
> -{
> -}
> -
>  /* An implementation of TARGET_CAN_USE_DOLOOP_P for targets that do
>     not support nested low-overhead loops.  */
>
> Index: gcc/targhooks.h
> ===================================================================
> --- gcc/targhooks.h     2019-07-10 19:41:20.127948228 +0100
> +++ gcc/targhooks.h     2019-08-15 14:28:02.045548244 +0100
> @@ -265,11 +265,6 @@ extern rtx default_load_bounds_for_arg (
>  extern void default_store_bounds_for_arg (rtx, rtx, rtx, rtx);
>  extern rtx default_load_returned_bounds (rtx);
>  extern void default_store_returned_bounds (rtx,rtx);
> -extern void default_setup_incoming_vararg_bounds (cumulative_args_t ca ATTRIBUTE_UNUSED,
> -                                                 machine_mode mode ATTRIBUTE_UNUSED,
> -                                                 tree type ATTRIBUTE_UNUSED,
> -                                                 int *pretend_arg_size ATTRIBUTE_UNUSED,
> -                                                 int second_time ATTRIBUTE_UNUSED);
>  extern bool default_optab_supported_p (int, machine_mode, machine_mode,
>                                        optimization_type);
>  extern unsigned int default_max_noce_ifcvt_seq_cost (edge);
> Index: gcc/config/i386/i386.c
> ===================================================================
> --- gcc/config/i386/i386.c      2019-08-13 22:35:11.737252196 +0100
> +++ gcc/config/i386/i386.c      2019-08-15 14:28:02.037548302 +0100
> @@ -4126,34 +4126,6 @@ ix86_setup_incoming_varargs (cumulative_
>      setup_incoming_varargs_64 (&next_cum);
>  }
>
> -static void
> -ix86_setup_incoming_vararg_bounds (cumulative_args_t cum_v,
> -                                  machine_mode mode,
> -                                  tree type,
> -                                  int *pretend_size ATTRIBUTE_UNUSED,
> -                                  int no_rtl)
> -{
> -  CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v);
> -  CUMULATIVE_ARGS next_cum;
> -  tree fntype;
> -
> -  gcc_assert (!no_rtl);
> -
> -  /* Do nothing if we use plain pointer to argument area.  */
> -  if (!TARGET_64BIT || cum->call_abi == MS_ABI)
> -    return;
> -
> -  fntype = TREE_TYPE (current_function_decl);
> -
> -  /* For varargs, we do not want to skip the dummy va_dcl argument.
> -     For stdargs, we do want to skip the last named argument.  */
> -  next_cum = *cum;
> -  if (stdarg_p (fntype))
> -    ix86_function_arg_advance (pack_cumulative_args (&next_cum), mode, type,
> -                              true);
> -}
> -
> -
>  /* Checks if TYPE is of kind va_list char *.  */
>
>  static bool
> @@ -23049,9 +23021,6 @@ #define TARGET_MODE_PRIORITY ix86_mode_p
>  #undef TARGET_CALL_FUSAGE_CONTAINS_NON_CALLEE_CLOBBERS
>  #define TARGET_CALL_FUSAGE_CONTAINS_NON_CALLEE_CLOBBERS true
>
> -#undef TARGET_SETUP_INCOMING_VARARG_BOUNDS
> -#define TARGET_SETUP_INCOMING_VARARG_BOUNDS ix86_setup_incoming_vararg_bounds
> -
>  #undef TARGET_OFFLOAD_OPTIONS
>  #define TARGET_OFFLOAD_OPTIONS \
>    ix86_offload_options

Patch
diff mbox series

Index: gcc/target.def
===================================================================
--- gcc/target.def	2019-08-13 22:33:30.929994105 +0100
+++ gcc/target.def	2019-08-15 14:28:02.041548275 +0100
@@ -4551,15 +4551,6 @@  returned by function call into @var{slot
  default_store_returned_bounds)
 
 DEFHOOK
-(setup_incoming_vararg_bounds,
- "Use it to store bounds for anonymous register arguments stored\n\
-into the stack.  Arguments meaning is similar to\n\
-@code{TARGET_SETUP_INCOMING_VARARGS}.",
- void, (cumulative_args_t args_so_far, machine_mode mode, tree type,
-	int *pretend_args_size, int second_time),
- default_setup_incoming_vararg_bounds)
-
-DEFHOOK
 (call_args,
  "While generating RTL for a function call, this target hook is invoked once\n\
 for each argument passed to the function, either a register returned by\n\
Index: gcc/doc/tm.texi
===================================================================
--- gcc/doc/tm.texi	2019-08-13 22:33:30.801995048 +0100
+++ gcc/doc/tm.texi	2019-08-15 14:28:02.041548275 +0100
@@ -5314,12 +5314,6 @@  This hook is used by expand pass to emit
 returned by function call into @var{slot}.
 @end deftypefn
 
-@deftypefn {Target Hook} void TARGET_SETUP_INCOMING_VARARG_BOUNDS (cumulative_args_t @var{args_so_far}, machine_mode @var{mode}, tree @var{type}, int *@var{pretend_args_size}, int @var{second_time})
-Use it to store bounds for anonymous register arguments stored
-into the stack.  Arguments meaning is similar to
-@code{TARGET_SETUP_INCOMING_VARARGS}.
-@end deftypefn
-
 @node Trampolines
 @section Support for Nested Functions
 @cindex support for nested functions
Index: gcc/doc/tm.texi.in
===================================================================
--- gcc/doc/tm.texi.in	2019-06-18 09:35:52.089892867 +0100
+++ gcc/doc/tm.texi.in	2019-08-15 14:28:02.041548275 +0100
@@ -3785,8 +3785,6 @@  These machine description macros help im
 
 @hook TARGET_STORE_RETURNED_BOUNDS
 
-@hook TARGET_SETUP_INCOMING_VARARG_BOUNDS
-
 @node Trampolines
 @section Support for Nested Functions
 @cindex support for nested functions
Index: gcc/targhooks.c
===================================================================
--- gcc/targhooks.c	2019-07-10 19:41:20.127948228 +0100
+++ gcc/targhooks.c	2019-08-15 14:28:02.041548275 +0100
@@ -2274,15 +2274,6 @@  std_gimplify_va_arg_expr (tree valist, t
   return build_va_arg_indirect_ref (addr);
 }
 
-void
-default_setup_incoming_vararg_bounds (cumulative_args_t ca ATTRIBUTE_UNUSED,
-				      machine_mode mode ATTRIBUTE_UNUSED,
-				      tree type ATTRIBUTE_UNUSED,
-				      int *pretend_arg_size ATTRIBUTE_UNUSED,
-				      int second_time ATTRIBUTE_UNUSED)
-{
-}
-
 /* An implementation of TARGET_CAN_USE_DOLOOP_P for targets that do
    not support nested low-overhead loops.  */
 
Index: gcc/targhooks.h
===================================================================
--- gcc/targhooks.h	2019-07-10 19:41:20.127948228 +0100
+++ gcc/targhooks.h	2019-08-15 14:28:02.045548244 +0100
@@ -265,11 +265,6 @@  extern rtx default_load_bounds_for_arg (
 extern void default_store_bounds_for_arg (rtx, rtx, rtx, rtx);
 extern rtx default_load_returned_bounds (rtx);
 extern void default_store_returned_bounds (rtx,rtx);
-extern void default_setup_incoming_vararg_bounds (cumulative_args_t ca ATTRIBUTE_UNUSED,
-						  machine_mode mode ATTRIBUTE_UNUSED,
-						  tree type ATTRIBUTE_UNUSED,
-						  int *pretend_arg_size ATTRIBUTE_UNUSED,
-						  int second_time ATTRIBUTE_UNUSED);
 extern bool default_optab_supported_p (int, machine_mode, machine_mode,
 				       optimization_type);
 extern unsigned int default_max_noce_ifcvt_seq_cost (edge);
Index: gcc/config/i386/i386.c
===================================================================
--- gcc/config/i386/i386.c	2019-08-13 22:35:11.737252196 +0100
+++ gcc/config/i386/i386.c	2019-08-15 14:28:02.037548302 +0100
@@ -4126,34 +4126,6 @@  ix86_setup_incoming_varargs (cumulative_
     setup_incoming_varargs_64 (&next_cum);
 }
 
-static void
-ix86_setup_incoming_vararg_bounds (cumulative_args_t cum_v,
-				   machine_mode mode,
-				   tree type,
-				   int *pretend_size ATTRIBUTE_UNUSED,
-				   int no_rtl)
-{
-  CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v);
-  CUMULATIVE_ARGS next_cum;
-  tree fntype;
-
-  gcc_assert (!no_rtl);
-
-  /* Do nothing if we use plain pointer to argument area.  */
-  if (!TARGET_64BIT || cum->call_abi == MS_ABI)
-    return;
-
-  fntype = TREE_TYPE (current_function_decl);
-
-  /* For varargs, we do not want to skip the dummy va_dcl argument.
-     For stdargs, we do want to skip the last named argument.  */
-  next_cum = *cum;
-  if (stdarg_p (fntype))
-    ix86_function_arg_advance (pack_cumulative_args (&next_cum), mode, type,
-			       true);
-}
-
-
 /* Checks if TYPE is of kind va_list char *.  */
 
 static bool
@@ -23049,9 +23021,6 @@  #define TARGET_MODE_PRIORITY ix86_mode_p
 #undef TARGET_CALL_FUSAGE_CONTAINS_NON_CALLEE_CLOBBERS
 #define TARGET_CALL_FUSAGE_CONTAINS_NON_CALLEE_CLOBBERS true
 
-#undef TARGET_SETUP_INCOMING_VARARG_BOUNDS
-#define TARGET_SETUP_INCOMING_VARARG_BOUNDS ix86_setup_incoming_vararg_bounds
-
 #undef TARGET_OFFLOAD_OPTIONS
 #define TARGET_OFFLOAD_OPTIONS \
   ix86_offload_options