]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/target.def
Correct a function pre/postcondition [PR102403].
[thirdparty/gcc.git] / gcc / target.def
index 4f8acfd2276a097390261fa76806dc08768b6587..c5d90cace80d75ef17cd5eddf657db8334f786de 100644 (file)
@@ -1,5 +1,5 @@
 /* Target hook definitions.
-   Copyright (C) 2001-2019 Free Software Foundation, Inc.
+   Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
@@ -179,12 +179,22 @@ The default is that no label is emitted.",
 /* Emit a directive for setting the personality for the function.  */
 DEFHOOK
 (emit_except_personality,
- "If the target implements @code{TARGET_ASM_UNWIND_EMIT}, this hook may be\
- used to emit a directive to install a personality hook into the unwind\
- info.  This hook should not be used if dwarf2 unwind info is used.",
+ "If the target implements @code{TARGET_ASM_UNWIND_EMIT}, this hook may be\n\
+used to emit a directive to install a personality hook into the unwind\n\
+info.  This hook should not be used if dwarf2 unwind info is used.",
  void, (rtx personality),
  NULL)
 
+/* If necessary, modify personality and LSDA references to handle
+   indirection.  This is used when the assembler supports CFI directives.  */
+DEFHOOK
+(make_eh_symbol_indirect,
+ "If necessary, modify personality and LSDA references to handle indirection.\n\
+The original symbol is in @code{origsymbol} and if @code{pubvis} is true\n\
+the symbol is visible outside the TU.",
+ rtx, (rtx origsymbol, bool pubvis),
+ NULL)
+
 /* Emit any directives required to unwind this instruction.  */
 DEFHOOK
 (unwind_emit,
@@ -196,11 +206,25 @@ returns @code{UI_TARGET}.",
 
 DEFHOOKPOD
 (unwind_emit_before_insn,
- "True if the @code{TARGET_ASM_UNWIND_EMIT} hook should be called before\
- the assembly for @var{insn} has been emitted, false if the hook should\
- be called afterward.",
+ "True if the @code{TARGET_ASM_UNWIND_EMIT} hook should be called before\n\
+the assembly for @var{insn} has been emitted, false if the hook should\n\
+be called afterward.",
  bool, true)
 
+/* Return true if the target needs extra instructions to restore the current
+   frame address after a DW_CFA_restore_state opcode.  */
+DEFHOOK
+(should_restore_cfa_state,
+ "For DWARF-based unwind frames, two CFI instructions provide for save and\n\
+restore of register state.  GCC maintains the current frame address (CFA)\n\
+separately from the register bank but the unwinder in libgcc preserves this\n\
+state along with the registers (and this is expected by the code that writes\n\
+the unwind frames).  This hook allows the target to specify that the CFA data\n\
+is not saved/restored along with the registers by the target unwinder so that\n\
+suitable additional instructions should be emitted to restore it.",
+ bool, (void),
+ hook_bool_void_false)
+
 /* Generate an internal label.
    For now this is just a wrapper for ASM_GENERATE_INTERNAL_LABEL.  */
 DEFHOOK_UNDOC
@@ -459,11 +483,11 @@ Return NULL if function should go to default text section.",
 /* Output the assembler code for function exit.  */
 DEFHOOK
 (function_switched_text_sections,
- "Used by the target to emit any assembler directives or additional\
-  labels needed when a function is partitioned between different\
-  sections.  Output should be written to @var{file}.  The function\
-  decl is available as @var{decl} and the new section is `cold' if\
-  @var{new_is_cold} is @code{true}.",
+ "Used by the target to emit any assembler directives or additional\n\
+labels needed when a function is partitioned between different\n\
+sections.  Output should be written to @var{file}.  The function\n\
+decl is available as @var{decl} and the new section is `cold' if\n\
+@var{new_is_cold} is @code{true}.",
  void, (FILE *file, tree decl, bool new_is_cold),
  default_function_switched_text_sections)
 
@@ -549,16 +573,18 @@ Whatever the actual target object format, this is often good enough.",
  void, (tree decl, int reloc),
  default_unique_section)
 
-/* Return the readonly data section associated with function DECL.  */
+/* Return the readonly data or relocated readonly data section
+   associated with function DECL.  */
 DEFHOOK
 (function_rodata_section,
- "Return the readonly data section associated with\n\
-@samp{DECL_SECTION_NAME (@var{decl})}.\n\
+ "Return the readonly data or reloc readonly data section associated with\n\
+@samp{DECL_SECTION_NAME (@var{decl})}. @var{relocatable} selects the latter\n\
+over the former.\n\
 The default version of this function selects @code{.gnu.linkonce.r.name} if\n\
 the function's section is @code{.gnu.linkonce.t.name}, @code{.rodata.name}\n\
-if function is in @code{.text.name}, and the normal readonly-data section\n\
-otherwise.",
- section *, (tree decl),
+or @code{.data.rel.ro.name} if function is in @code{.text.name}, and\n\
+the normal readonly-data or reloc readonly data section otherwise.",
+ section *, (tree decl, bool relocatable),
  default_function_rodata_section)
 
 /* Nonnull if the target wants to override the default ".rodata" prefix
@@ -573,8 +599,8 @@ the string if a different section name should be used.",
 /* Return the section to be used for transactional memory clone tables.  */
 DEFHOOK
 (tm_clone_table_section,
- "Return the section that should be used for transactional memory clone\
-  tables.",
+ "Return the section that should be used for transactional memory clone\n\
+tables.",
  section *, (void), default_clone_table_section)
 
 /* Output a constructor for a symbol with a given priority.  */
@@ -745,41 +771,7 @@ directive to annotate @var{symbol} as used.  The Darwin target uses the\n\
 DEFHOOK
 (record_gcc_switches,
  "Provides the target with the ability to record the gcc command line\n\
-switches that have been passed to the compiler, and options that are\n\
-enabled.  The @var{type} argument specifies what is being recorded.\n\
-It can take the following values:\n\
-\n\
-@table @gcctabopt\n\
-@item SWITCH_TYPE_PASSED\n\
-@var{text} is a command line switch that has been set by the user.\n\
-\n\
-@item SWITCH_TYPE_ENABLED\n\
-@var{text} is an option which has been enabled.  This might be as a\n\
-direct result of a command line switch, or because it is enabled by\n\
-default or because it has been enabled as a side effect of a different\n\
-command line switch.  For example, the @option{-O2} switch enables\n\
-various different individual optimization passes.\n\
-\n\
-@item SWITCH_TYPE_DESCRIPTIVE\n\
-@var{text} is either NULL or some descriptive text which should be\n\
-ignored.  If @var{text} is NULL then it is being used to warn the\n\
-target hook that either recording is starting or ending.  The first\n\
-time @var{type} is SWITCH_TYPE_DESCRIPTIVE and @var{text} is NULL, the\n\
-warning is for start up and the second time the warning is for\n\
-wind down.  This feature is to allow the target hook to make any\n\
-necessary preparations before it starts to record switches and to\n\
-perform any necessary tidying up after it has finished recording\n\
-switches.\n\
-\n\
-@item SWITCH_TYPE_LINE_START\n\
-This option can be ignored by this target hook.\n\
-\n\
-@item  SWITCH_TYPE_LINE_END\n\
-This option can be ignored by this target hook.\n\
-@end table\n\
-\n\
-The hook's return value must be zero.  Other return values may be\n\
-supported in the future.\n\
+switches provided as argument.\n\
 \n\
 By default this hook is set to NULL, but an example implementation is\n\
 provided for ELF based targets.  Called @var{elf_record_gcc_switches},\n\
@@ -787,7 +779,7 @@ it records the switches as ASCII text inside a new, string mergeable\n\
 section in the assembler output file.  The name of the new section is\n\
 provided by the @code{TARGET_ASM_RECORD_GCC_SWITCHES_SECTION} target\n\
 hook.",
int, (print_switch_type type, const char *text),
void, (const char *),
  NULL)
 
 /* The name of the section that the example ELF implementation of
@@ -818,10 +810,10 @@ is @code{NULL}, which disables the use of section anchors altogether.",
 
 DEFHOOK
 (output_ident,
- "Output a string based on @var{name}, suitable for the @samp{#ident} \
- directive, or the equivalent directive or pragma in non-C-family languages. \
- If this hook is not defined, nothing is output for the @samp{#ident} \
- directive.",
+ "Output a string based on @var{name}, suitable for the @samp{#ident}\n\
+directive, or the equivalent directive or pragma in non-C-family languages.\n\
+If this hook is not defined, nothing is output for the @samp{#ident}\n\
+directive.",
  void, (const char *name),
  hook_void_constcharptr)
 
@@ -866,11 +858,11 @@ to generate it on the spot.",
 
 DEFHOOK
 (output_source_filename,
- "Output DWARF debugging information which indicates that filename\
- @var{name} is the current source file to the stdio stream @var{file}.\n\
- \n\
- This target hook need not be defined if the standard form of output\
- for the file format in use is appropriate.",
+ "Output DWARF debugging information which indicates that filename\n\
+@var{name} is the current source file to the stdio stream @var{file}.\n\
+\n\
+This target hook need not be defined if the standard form of output\n\
+for the file format in use is appropriate.",
  void ,(FILE *file, const char *name),
  default_asm_output_source_filename)
 
@@ -926,11 +918,11 @@ DEFHOOK_UNDOC
    ASM_OUTPUT_LABELREF, returning result as an IDENTIFIER_NODE.  */
 DEFHOOK
 (mangle_assembler_name,
- "Given a symbol @var{name}, perform same mangling as @code{varasm.c}'s\
- @code{assemble_name}, but in memory rather than to a file stream, returning\
- result as an @code{IDENTIFIER_NODE}.  Required for correct LTO symtabs.  The\
- default implementation calls the @code{TARGET_STRIP_NAME_ENCODING} hook and\
- then prepends the @code{USER_LABEL_PREFIX}, if any.",
+ "Given a symbol @var{name}, perform same mangling as @code{varasm.c}'s\n\
+@code{assemble_name}, but in memory rather than to a file stream, returning\n\
+result as an @code{IDENTIFIER_NODE}.  Required for correct LTO symtabs.  The\n\
+default implementation calls the @code{TARGET_STRIP_NAME_ENCODING} hook and\n\
+then prepends the @code{USER_LABEL_PREFIX}, if any.",
  tree, (const char *name),
  default_mangle_assembler_name)
 
@@ -1519,7 +1511,7 @@ in its second parameter.",
 void, (rtx_insn *insn, int x),
 hook_void_rtx_insn_int)
 
-/* The following member value is a function that returns true is
+/* The following member value is a function that returns true is
    dispatch schedling is supported in hardware and condition passed
    as the second parameter is true.  */
 DEFHOOK
@@ -1669,6 +1661,21 @@ int, (void), NULL)
 
 HOOK_VECTOR_END (simt)
 
+/* Functions relating to OpenMP.  */
+#undef HOOK_PREFIX
+#define HOOK_PREFIX "TARGET_OMP_"
+HOOK_VECTOR (TARGET_OMP, omp)
+
+DEFHOOK
+(device_kind_arch_isa,
+"Return 1 if @var{trait} @var{name} is present in the OpenMP context's\n\
+device trait set, return 0 if not present in any OpenMP context in the\n\
+whole translation unit, or -1 if not present in the current OpenMP context\n\
+but might be present in another OpenMP context in the same TU.",
+int, (enum omp_device_kind_arch_isa trait, const char *name), NULL)
+
+HOOK_VECTOR_END (omp)
+
 /* Functions relating to openacc.  */
 #undef HOOK_PREFIX
 #define HOOK_PREFIX "TARGET_GOACC_"
@@ -1679,7 +1686,7 @@ DEFHOOK
 "This hook should check the launch dimensions provided for an OpenACC\n\
 compute region, or routine.  Defaulted values are represented as -1\n\
 and non-constant values as 0.  The @var{fn_level} is negative for the\n\
-function corresponding to the compute region.  For a routine is is the\n\
+function corresponding to the compute region.  For a routine it is the\n\
 outermost level at which partitioned execution may be spawned.  The hook\n\
 should verify non-default values.  If DECL is NULL, global defaults\n\
 are being validated and unspecified defaults should be filled in.\n\
@@ -1719,6 +1726,57 @@ for allocating any storage for reductions when necessary.",
 void, (gcall *call),
 default_goacc_reduction)
 
+DEFHOOK
+(adjust_private_decl,
+"This hook, if defined, is used by accelerator target back-ends to adjust\n\
+OpenACC variable declarations that should be made private to the given\n\
+parallelism level (i.e. @code{GOMP_DIM_GANG}, @code{GOMP_DIM_WORKER} or\n\
+@code{GOMP_DIM_VECTOR}).  A typical use for this hook is to force variable\n\
+declarations at the @code{gang} level to reside in GPU shared memory.\n\
+@var{loc} may be used for diagnostic purposes.\n\
+\n\
+You may also use the @code{TARGET_GOACC_EXPAND_VAR_DECL} hook if the\n\
+adjusted variable declaration needs to be expanded to RTL in a non-standard\n\
+way.",
+tree, (location_t loc, tree var, int level),
+NULL)
+
+DEFHOOK
+(expand_var_decl,
+"This hook, if defined, is used by accelerator target back-ends to expand\n\
+specially handled kinds of @code{VAR_DECL} expressions.  A particular use is\n\
+to place variables with specific attributes inside special accelarator\n\
+memories.  A return value of @code{NULL} indicates that the target does not\n\
+handle this @code{VAR_DECL}, and normal RTL expanding is resumed.\n\
+\n\
+Only define this hook if your accelerator target needs to expand certain\n\
+@code{VAR_DECL} nodes in a way that differs from the default.  You can also adjust\n\
+private variables at OpenACC device-lowering time using the\n\
+@code{TARGET_GOACC_ADJUST_PRIVATE_DECL} target hook.",
+rtx, (tree var),
+NULL)
+
+DEFHOOK
+(create_worker_broadcast_record,
+"Create a record used to propagate local-variable state from an active\n\
+worker to other workers.  A possible implementation might adjust the type\n\
+of REC to place the new variable in shared GPU memory.\n\
+\n\
+Presence of this target hook indicates that middle end neutering/broadcasting\n\
+be used.",
+tree, (tree rec, bool sender, const char *name, unsigned HOST_WIDE_INT offset),
+NULL)
+
+DEFHOOK
+(shared_mem_layout,
+"Lay out a fixed shared-memory region on the target.  The LO and HI\n\
+arguments should be set to a range of addresses that can be used for worker\n\
+broadcasting. The dimensions, reduction size and gang-private size\n\
+arguments are for the current offload region.",
+void, (unsigned HOST_WIDE_INT *, unsigned HOST_WIDE_INT *, int[],
+       unsigned HOST_WIDE_INT[], unsigned HOST_WIDE_INT[]),
+NULL)
+
 HOOK_VECTOR_END (goacc)
 
 /* Functions relating to vectorization.  */
@@ -1782,22 +1840,6 @@ return type of the vectorized function shall be of vector type\n\
  tree, (tree fndecl, tree vec_type_out, tree vec_type_in),
  default_builtin_md_vectorized_function)
 
-/* Returns a function declaration for a builtin that realizes the
-   vector conversion, or NULL_TREE if not available.  */
-DEFHOOK
-(builtin_conversion,
- "This hook should return the DECL of a function that implements conversion of the\n\
-input vector of type @var{src_type} to type @var{dest_type}.\n\
-The value of @var{code} is one of the enumerators in @code{enum tree_code} and\n\
-specifies how the conversion is to be applied\n\
-(truncation, rounding, etc.).\n\
-\n\
-If this hook is defined, the autovectorizer will use the\n\
-@code{TARGET_VECTORIZE_BUILTIN_CONVERSION} target hook when vectorizing\n\
-conversion. Otherwise, it will return @code{NULL_TREE}.",
- tree, (unsigned code, tree dest_type, tree src_type),
- default_builtin_vectorized_conversion)
-
 /* Cost of different vector/scalar statements in vectorization cost
    model. In case of misaligned vector loads and stores the cost depends
    on the data type and misalignment value.  */
@@ -1827,7 +1869,9 @@ correct for most targets.",
    iterations) for the given scalar type.  */
 DEFHOOK
 (vector_alignment_reachable,
- "Return true if vector alignment is reachable (by peeling N iterations) for the given scalar type @var{type}.  @var{is_packed} is false if the scalar access using @var{type} is known to be naturally aligned.",
+ "Return true if vector alignment is reachable (by peeling N iterations)\n\
+for the given scalar type @var{type}.  @var{is_packed} is false if the scalar\n\
+access using @var{type} is known to be naturally aligned.",
  bool, (const_tree type, bool is_packed),
  default_builtin_vector_alignment_reachable)
 
@@ -1838,7 +1882,7 @@ vectors of mode @var{mode} using the permutation vector @code{sel}, and\n\
 also to emit such a permutation.  In the former case @var{in0}, @var{in1}\n\
 and @var{out} are all null.  In the latter case @var{in0} and @var{in1} are\n\
 the source vectors and @var{out} is the destination vector; all three are\n\
-registers of mode @var{mode}.  @var{in1} is the same as @var{in0} if\n\
+operands of mode @var{mode}.  @var{in1} is the same as @var{in0} if\n\
 @var{sel} describes a permutation on one vector instead of two.\n\
 \n\
 Return true if the operation is possible, emitting instructions for it\n\
@@ -1894,35 +1938,80 @@ reached.  The default is @var{mode} which means no splitting.",
 /* Returns a mask of vector sizes to iterate over when auto-vectorizing
    after processing the preferred one derived from preferred_simd_mode.  */
 DEFHOOK
-(autovectorize_vector_sizes,
- "If the mode returned by @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE} is not\n\
-the only one that is worth considering, this hook should add all suitable\n\
-vector sizes to @var{sizes}, in order of decreasing preference.  The first\n\
-one should be the size of @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE}.\n\
-If @var{all} is true, add suitable vector sizes even when they are generally\n\
+(autovectorize_vector_modes,
+ "If using the mode returned by @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE}\n\
+is not the only approach worth considering, this hook should add one mode to\n\
+@var{modes} for each useful alternative approach.  These modes are then\n\
+passed to @code{TARGET_VECTORIZE_RELATED_MODE} to obtain the vector mode\n\
+for a given element mode.\n\
+\n\
+The modes returned in @var{modes} should use the smallest element mode\n\
+possible for the vectorization approach that they represent, preferring\n\
+integer modes over floating-poing modes in the event of a tie.  The first\n\
+mode should be the @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE} for its\n\
+element mode.\n\
+\n\
+If @var{all} is true, add suitable vector modes even when they are generally\n\
 not expected to be worthwhile.\n\
 \n\
+The hook returns a bitmask of flags that control how the modes in\n\
+@var{modes} are used.  The flags are:\n\
+@table @code\n\
+@item VECT_COMPARE_COSTS\n\
+Tells the loop vectorizer to try all the provided modes and pick the one\n\
+with the lowest cost.  By default the vectorizer will choose the first\n\
+mode that works.\n\
+@end table\n\
+\n\
 The hook does not need to do anything if the vector returned by\n\
 @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE} is the only one relevant\n\
-for autovectorization.  The default implementation does nothing.",
- void,
- (vector_sizes *sizes, bool all),
- default_autovectorize_vector_sizes)
+for autovectorization.  The default implementation adds no modes and\n\
+returns 0.",
+ unsigned int,
+ (vector_modes *modes, bool all),
+ default_autovectorize_vector_modes)
+
+DEFHOOK
+(related_mode,
+ "If a piece of code is using vector mode @var{vector_mode} and also wants\n\
+to operate on elements of mode @var{element_mode}, return the vector mode\n\
+it should use for those elements.  If @var{nunits} is nonzero, ensure that\n\
+the mode has exactly @var{nunits} elements, otherwise pick whichever vector\n\
+size pairs the most naturally with @var{vector_mode}.  Return an empty\n\
+@code{opt_machine_mode} if there is no supported vector mode with the\n\
+required properties.\n\
+\n\
+There is no prescribed way of handling the case in which @var{nunits}\n\
+is zero.  One common choice is to pick a vector mode with the same size\n\
+as @var{vector_mode}; this is the natural choice if the target has a\n\
+fixed vector size.  Another option is to choose a vector mode with the\n\
+same number of elements as @var{vector_mode}; this is the natural choice\n\
+if the target has a fixed number of elements.  Alternatively, the hook\n\
+might choose a middle ground, such as trying to keep the number of\n\
+elements as similar as possible while applying maximum and minimum\n\
+vector sizes.\n\
+\n\
+The default implementation uses @code{mode_for_vector} to find the\n\
+requested mode, returning a mode with the same size as @var{vector_mode}\n\
+when @var{nunits} is zero.  This is the correct behavior for most targets.",
+ opt_machine_mode,
+ (machine_mode vector_mode, scalar_mode element_mode, poly_uint64 nunits),
+ default_vectorize_related_mode)
 
 /* Function to get a target mode for a vector mask.  */
 DEFHOOK
 (get_mask_mode,
- "A vector mask is a value that holds one boolean result for every element\n\
-in a vector.  This hook returns the machine mode that should be used to\n\
-represent such a mask when the vector in question is @var{length} bytes\n\
-long and contains @var{nunits} elements.  The hook returns an empty\n\
-@code{opt_machine_mode} if no such mode exists.\n\
-\n\
-The default implementation returns the mode of an integer vector that\n\
-is @var{length} bytes long and that contains @var{nunits} elements,\n\
-if such a mode exists.",
+ "Return the mode to use for a vector mask that holds one boolean\n\
+result for each element of vector mode @var{mode}.  The returned mask mode\n\
+can be a vector of integers (class @code{MODE_VECTOR_INT}), a vector of\n\
+booleans (class @code{MODE_VECTOR_BOOL}) or a scalar integer (class\n\
+@code{MODE_INT}).  Return an empty @code{opt_machine_mode} if no such\n\
+mask mode exists.\n\
+\n\
+The default implementation returns a @code{MODE_VECTOR_INT} with the\n\
+same size and number of elements as @var{mode}, if such a mode exists.",
  opt_machine_mode,
- (poly_uint64 nunits, poly_uint64 length),
+ (machine_mode mode),
  default_get_mask_mode)
 
 /* Function to say whether a masked operation is expensive when the
@@ -1963,14 +2052,16 @@ stores.",
 /* Target function to initialize the cost model for a loop or block.  */
 DEFHOOK
 (init_cost,
- "This hook should initialize target-specific data structures in preparation "
- "for modeling the costs of vectorizing a loop or basic block.  The default "
- "allocates three unsigned integers for accumulating costs for the prologue, "
- "body, and epilogue of the loop or basic block.  If @var{loop_info} is "
- "non-NULL, it identifies the loop being vectorized; otherwise a single block "
- "is being vectorized.",
+ "This hook should initialize target-specific data structures in preparation\n\
+for modeling the costs of vectorizing a loop or basic block.  The default\n\
+allocates three unsigned integers for accumulating costs for the prologue,\n\
+body, and epilogue of the loop or basic block.  If @var{loop_info} is\n\
+non-NULL, it identifies the loop being vectorized; otherwise a single block\n\
+is being vectorized.  If @var{costing_for_scalar} is true, it indicates the\n\
+current cost model is for the scalar version of a loop or block; otherwise\n\
+it is for the vector version.",
  void *,
- (class loop *loop_info),
+ (class loop *loop_info, bool costing_for_scalar),
  default_init_cost)
 
 /* Target function to record N statements of the given kind using the
@@ -1978,16 +2069,16 @@ DEFHOOK
     block.  */
 DEFHOOK
 (add_stmt_cost,
- "This hook should update the target-specific @var{data} in response to "
- "adding @var{count} copies of the given @var{kind} of statement to a "
- "loop or basic block.  The default adds the builtin vectorizer cost for "
- "the copies of the statement to the accumulator specified by @var{where}, "
- "(the prologue, body, or epilogue) and returns the amount added.  The "
- "return value should be viewed as a tentative cost that may later be "
- "revised.",
+ "This hook should update the target-specific @var{data} in response to\n\
+adding @var{count} copies of the given @var{kind} of statement to a\n\
+loop or basic block.  The default adds the builtin vectorizer cost for\n\
+the copies of the statement to the accumulator specified by @var{where},\n\
+(the prologue, body, or epilogue) and returns the amount added.  The\n\
+return value should be viewed as a tentative cost that may later be\n\
+revised.",
  unsigned,
- (void *data, int count, enum vect_cost_for_stmt kind,
-  class _stmt_vec_info *stmt_info, int misalign,
+ (class vec_info *, void *data, int count, enum vect_cost_for_stmt kind,
+  class _stmt_vec_info *stmt_info, tree vectype, int misalign,
   enum vect_cost_model_location where),
  default_add_stmt_cost)
 
@@ -1995,10 +2086,10 @@ DEFHOOK
    loop or block.  */
 DEFHOOK
 (finish_cost,
- "This hook should complete calculations of the cost of vectorizing a loop "
- "or basic block based on @var{data}, and return the prologue, body, and "
- "epilogue costs as unsigned integers.  The default returns the value of "
- "the three accumulators.",
+ "This hook should complete calculations of the cost of vectorizing a loop\n\
+or basic block based on @var{data}, and return the prologue, body, and\n\
+epilogue costs as unsigned integers.  The default returns the value of\n\
+the three accumulators.",
  void,
  (void *data, unsigned *prologue_cost, unsigned *body_cost,
   unsigned *epilogue_cost),
@@ -2007,9 +2098,9 @@ DEFHOOK
 /* Function to delete target-specific cost modeling data.  */
 DEFHOOK
 (destroy_cost_data,
- "This hook should release @var{data} and any related data structures "
- "allocated by TARGET_VECTORIZE_INIT_COST.  The default releases the "
- "accumulator.",
+ "This hook should release @var{data} and any related data structures\n\
+allocated by TARGET_VECTORIZE_INIT_COST.  The default releases the\n\
+accumulator.",
  void,
  (void *data),
  default_destroy_cost_data)
@@ -2208,6 +2299,17 @@ needed.",
  void, (tree node, tree *attr_ptr),
  hook_void_tree_treeptr)
 
+/* Perform additional target-specific processing of generic attributes.  */
+DEFHOOK
+(handle_generic_attribute,
+ "Define this target hook if you want to be able to perform additional\n\
+target-specific processing of an attribute which is handled generically\n\
+by a front end.  The arguments are the same as those which are passed to\n\
+attribute handlers.  So far this only affects the @var{noinit} and\n\
+@var{section} attribute.",
+ tree, (tree *node, tree name, tree args, int flags, bool *no_add_attrs),
+ hook_tree_treeptr_tree_tree_int_boolptr_null)
+
 /* Return true if FNDECL (which has at least one machine attribute)
    can be inlined despite its machine attributes, false otherwise.  */
 DEFHOOK
@@ -2270,13 +2372,13 @@ DEFHOOK_UNDOC
 
 DEFHOOK
 (float_exceptions_rounding_supported_p,
- "Returns true if the target supports IEEE 754 floating-point exceptions\
- and rounding modes, false otherwise.  This is intended to relate to the\
- @code{float} and @code{double} types, but not necessarily @code{long double}.\
- By default, returns true if the @code{adddf3} instruction pattern is\
- available and false otherwise, on the assumption that hardware floating\
- point supports exceptions and rounding modes but software floating point\
- does not.",
+ "Returns true if the target supports IEEE 754 floating-point exceptions\n\
+and rounding modes, false otherwise.  This is intended to relate to the\n\
+@code{float} and @code{double} types, but not necessarily @code{long double}.\n\
+By default, returns true if the @code{adddf3} instruction pattern is\n\
+available and false otherwise, on the assumption that hardware floating\n\
+point supports exceptions and rounding modes but software floating point\n\
+does not.",
  bool, (void),
  default_float_exceptions_rounding_supported_p)
 
@@ -2386,6 +2488,24 @@ another @code{CALL_EXPR}.\n\
 @var{arglist} really has type @samp{VEC(tree,gc)*}",
  tree, (unsigned int /*location_t*/ loc, tree fndecl, void *arglist), NULL)
 
+DEFHOOK
+(check_builtin_call,
+ "Perform semantic checking on a call to a machine-specific built-in\n\
+function after its arguments have been constrained to the function\n\
+signature.  Return true if the call is valid, otherwise report an error\n\
+and return false.\n\
+\n\
+This hook is called after @code{TARGET_RESOLVE_OVERLOADED_BUILTIN}.\n\
+The call was originally to built-in function @var{orig_fndecl},\n\
+but after the optional @code{TARGET_RESOLVE_OVERLOADED_BUILTIN}\n\
+step is now to built-in function @var{fndecl}.  @var{loc} is the\n\
+location of the call and @var{args} is an array of function arguments,\n\
+of which there are @var{nargs}.  @var{arg_loc} specifies the location\n\
+of each argument.",
+ bool, (location_t loc, vec<location_t> arg_loc, tree fndecl,
+       tree orig_fndecl, unsigned int nargs, tree *args),
+ NULL)
+
 /* Fold a target-specific builtin to a tree valid for both GIMPLE
    and GENERIC.  */
 DEFHOOK
@@ -2545,8 +2665,11 @@ set via @code{__attribute__}.",
 DEFHOOK
 (libc_has_function,
  "This hook determines whether a function from a class of functions\n\
-@var{fn_class} is present in the target C library.",
- bool, (enum function_class fn_class),
+@var{fn_class} is present in the target C library.  If @var{type} is NULL,\n\
+the caller asks for support for all standard (float, double, long double)\n\
+types.  If @var{type} is non-NULL, the caller asks for support for a\n\
+specific type.",
+ bool, (enum function_class fn_class, tree type),
  default_libc_has_function)
 
 DEFHOOK
@@ -2578,46 +2701,14 @@ cannot_modify_jumps_past_reload_p ()\n\
 /* True if FOLLOWER may be modified to follow FOLLOWEE.  */
 DEFHOOK
 (can_follow_jump,
- "FOLLOWER and FOLLOWEE are JUMP_INSN instructions;\
-  return true if FOLLOWER may be modified to follow FOLLOWEE;\
-  false, if it can't.\
-  For example, on some targets, certain kinds of branches can't be made to\
-  follow through a hot/cold partitioning.",
+ "FOLLOWER and FOLLOWEE are JUMP_INSN instructions;\n\
+return true if FOLLOWER may be modified to follow FOLLOWEE;\n\
+false, if it can't.\n\
+For example, on some targets, certain kinds of branches can't be made to\n\
+follow through a hot/cold partitioning.",
  bool, (const rtx_insn *follower, const rtx_insn *followee),
  hook_bool_const_rtx_insn_const_rtx_insn_true)
 
-/* Return a register class for which branch target register
-   optimizations should be applied.  */
-DEFHOOK
-(branch_target_register_class,
- "This target hook returns a register class for which branch target register\n\
-optimizations should be applied.  All registers in this class should be\n\
-usable interchangeably.  After reload, registers in this class will be\n\
-re-allocated and loads will be hoisted out of loops and be subjected\n\
-to inter-block scheduling.",
- reg_class_t, (void),
- default_branch_target_register_class)
-
-/* Return true if branch target register optimizations should include
-   callee-saved registers that are not already live during the current
-   function.  AFTER_PE_GEN is true if prologues and epilogues have
-   already been generated.  */
-DEFHOOK
-(branch_target_register_callee_saved,
- "Branch target register optimization will by default exclude callee-saved\n\
-registers\n\
-that are not already live during the current function; if this target hook\n\
-returns true, they will be included.  The target code must than make sure\n\
-that all target registers in the class returned by\n\
-@samp{TARGET_BRANCH_TARGET_REGISTER_CLASS} that might need saving are\n\
-saved.  @var{after_prologue_epilogue_gen} indicates if prologues and\n\
-epilogues have already been generated.  Note, even if you only return\n\
-true when @var{after_prologue_epilogue_gen} is false, you still are likely\n\
-to have to make special provisions in @code{INITIAL_ELIMINATION_OFFSET}\n\
-to reserve space for caller-saved target registers.",
- bool, (bool after_prologue_epilogue_gen),
- hook_bool_bool_false)
-
 /* Return true if the target supports conditional execution.  */
 DEFHOOK
 (have_conditional_execution,
@@ -2634,7 +2725,7 @@ DEFHOOK
  with @code{CC} for passing to @code{gen_ccmp_next} or @code{cbranch_optab}.\n\
  The insns to prepare the compare are saved in @var{prep_seq} and the compare\n\
  insns are saved in @var{gen_seq}.  They will be emitted when all the\n\
- compares in the the conditional comparision are generated without error.\n\
+ compares in the conditional comparision are generated without error.\n\
  @var{code} is the @code{rtx_code} of the compare for @var{op0} and @var{op1}.",
  rtx, (rtx_insn **prep_seq, rtx_insn **gen_seq, int code, tree op0, tree op1),
  NULL)
@@ -2656,6 +2747,15 @@ DEFHOOK
  rtx, (rtx_insn **prep_seq, rtx_insn **gen_seq, rtx prev, int cmp_code, tree op0, tree op1, int bit_code),
  NULL)
 
+DEFHOOK
+(gen_memset_scratch_rtx,
+ "This hook should return an rtx for a scratch register in @var{mode} to\n\
+be used when expanding memset calls.  The backend can use a hard scratch\n\
+register to avoid stack realignment when expanding memset.  The default\n\
+is @code{gen_reg_rtx}.",
+ rtx, (machine_mode mode),
+ gen_reg_rtx)
+
 /* Return a new value for loop unroll size.  */
 DEFHOOK
 (loop_unroll_adjust,
@@ -2679,6 +2779,18 @@ The default definition returns true.",
  bool, (machine_mode mode, rtx x),
  hook_bool_mode_rtx_true)
 
+/* True if X is a TLS operand whose value should be pre-computed.  */
+DEFHOOK
+(precompute_tls_p,
+ "This hook returns true if @var{x} is a TLS operand on the target\n\
+machine that should be pre-computed when used as the argument in a call.\n\
+You can assume that @var{x} satisfies @code{CONSTANT_P}, so you need not \n\
+check this.\n\
+\n\
+The default definition returns false.",
+ bool, (machine_mode mode, rtx x),
+ hook_bool_mode_rtx_false)
+
 /* True if the constant X cannot be placed in the constant pool.  */
 DEFHOOK
 (cannot_force_const_mem,
@@ -2984,11 +3096,11 @@ The default version of this hook use the target macro\n\
    enabled.  */
 DEFHOOK
 (keep_leaf_when_profiled,
- "This target hook returns true if the target wants the leaf flag for\
- the current function to stay true even if it calls mcount.  This might\
- make sense for targets using the leaf flag only to determine whether a\
- stack frame needs to be generated or not and for which the call to\
- mcount is generated before the function prologue.",
+ "This target hook returns true if the target wants the leaf flag for\n\
+the current function to stay true even if it calls mcount.  This might\n\
+make sense for targets using the leaf flag only to determine whether a\n\
+stack frame needs to be generated or not and for which the call to\n\
+mcount is generated before the function prologue.",
  bool, (void),
  default_keep_leaf_when_profiled)
 
@@ -3107,7 +3219,9 @@ DEFHOOK
 @var{inprec} bits to one of @var{outprec} bits (where @var{outprec} is\n\
 smaller than @var{inprec}) by merely operating on it as if it had only\n\
 @var{outprec} bits.  The default returns true unconditionally, which\n\
-is correct for most machines.\n\
+is correct for most machines.  When @code{TARGET_TRULY_NOOP_TRUNCATION}\n\
+returns false, the machine description should provide a @code{trunc}\n\
+optab to specify the RTL that performs the required truncation.\n\
 \n\
 If @code{TARGET_MODES_TIEABLE_P} returns false for a pair of modes,\n\
 suboptimal code can result if this hook returns true for the corresponding\n\
@@ -3150,7 +3264,7 @@ In order to enforce the representation of @code{mode},\n\
  int, (scalar_int_mode mode, scalar_int_mode rep_mode),
  default_mode_rep_extended)
 
- DEFHOOK
+DEFHOOK
 (setjmp_preserves_nonvolatile_regs_p,
  "On some targets, it is assumed that the compiler will spill all pseudos\n\
   that are live across a call to @code{setjmp}, while other targets treat\n\
@@ -3177,11 +3291,11 @@ hook returns true for both @code{ptr_mode} and @code{Pmode}.",
 /* Disambiguate with errno.  */
 DEFHOOK
 (ref_may_alias_errno,
- "Define this to return nonzero if the memory reference @var{ref}\
-  may alias with the system C library errno location.  The default\
-  version of this hook assumes the system C library errno location\
-  is either a declaration of type int or accessed by dereferencing\
-  a pointer to int.",
+ "Define this to return nonzero if the memory reference @var{ref}\n\
+may alias with the system C library errno location.  The default\n\
+version of this hook assumes the system C library errno location\n\
+is either a declaration of type int or accessed by dereferencing\n\
+a pointer to int.",
  bool, (ao_ref *ref),
  default_ref_may_alias_errno)
 
@@ -3307,6 +3421,13 @@ HOOK_VECTOR_END (addr_space)
 #undef HOOK_PREFIX
 #define HOOK_PREFIX "TARGET_"
 
+DEFHOOK
+(lower_local_decl_alignment,
+ "Define this hook to lower alignment of local, parm or result\n\
+decl @samp{(@var{decl})}.",
+ void, (tree decl),
+ hook_void_tree)
+
 DEFHOOK
 (static_rtx_alignment,
  "This hook returns the preferred alignment in bits for a\n\
@@ -3369,6 +3490,29 @@ must have move patterns for this mode.",
  bool, (machine_mode mode),
  hook_bool_mode_false)
 
+DEFHOOK
+(compatible_vector_types_p,
+ "Return true if there is no target-specific reason for treating\n\
+vector types @var{type1} and @var{type2} as distinct types.  The caller\n\
+has already checked for target-independent reasons, meaning that the\n\
+types are known to have the same mode, to have the same number of elements,\n\
+and to have what the caller considers to be compatible element types.\n\
+\n\
+The main reason for defining this hook is to reject pairs of types\n\
+that are handled differently by the target's calling convention.\n\
+For example, when a new @var{N}-bit vector architecture is added\n\
+to a target, the target may want to handle normal @var{N}-bit\n\
+@code{VECTOR_TYPE} arguments and return values in the same way as\n\
+before, to maintain backwards compatibility.  However, it may also\n\
+provide new, architecture-specific @code{VECTOR_TYPE}s that are passed\n\
+and returned in a more efficient way.  It is then important to maintain\n\
+a distinction between the ``normal'' @code{VECTOR_TYPE}s and the new\n\
+architecture-specific ones.\n\
+\n\
+The default implementation returns true, which is correct for most targets.",
+ bool, (const_tree type1, const_tree type2),
+ hook_bool_const_tree_const_tree_true)
+
 DEFHOOK
 (vector_alignment,
  "This hook can be used to define the alignment for a vector of type\n\
@@ -3562,6 +3706,15 @@ move would be greater than that of a library call.",
         enum by_pieces_operation op, bool speed_p),
  default_use_by_pieces_infrastructure_p)
 
+DEFHOOK
+(overlap_op_by_pieces_p,
+ "This target hook should return true if when the @code{by_pieces}\n\
+infrastructure is used, an offset adjusted unaligned memory operation\n\
+in the smallest integer mode for the last piece operation of a memory\n\
+region can be generated to avoid doing more than one smaller operations.",
+ bool, (void),
+ hook_bool_void_false)
+
 DEFHOOK
 (compare_by_pieces_branch_ratio,
  "When expanding a block comparison in MODE, gcc can try to reduce the\n\
@@ -3652,10 +3805,10 @@ of spill registers and print a fatal error message.",
    target is constrainted to use post-reload comparison elimination.  */
 DEFHOOKPOD
 (flags_regnum,
- "If the target has a dedicated flags register, and it needs to use the\
- post-reload comparison elimination pass, then this value should be set\
- appropriately.",
- unsigned int, INVALID_REGNUM)
+ "If the target has a dedicated flags register, and it needs to use the\n\
+post-reload comparison elimination pass, or the delay slot filler pass,\n\
+then this value should be set appropriately.",
+unsigned int, INVALID_REGNUM)
 
 /* Compute a (partial) cost for rtx X.  Return true if the complete
    cost has been computed, and false if subexpressions should be
@@ -3783,12 +3936,26 @@ candidate as a replacement for the if-convertible sequence described in\n\
 bool, (rtx_insn *seq, struct noce_if_info *if_info),
 default_noce_conversion_profitable_p)
 
+/* Return true if new_addr should be preferred over the existing address used by
+   memref in insn.  */
+DEFHOOK
+(new_address_profitable_p,
+ "Return @code{true} if it is profitable to replace the address in\n\
+@var{memref} with @var{new_addr}.  This allows targets to prevent the\n\
+scheduler from undoing address optimizations.  The instruction containing the\n\
+memref is @var{insn}.  The default implementation returns @code{true}.",
+bool, (rtx memref, rtx_insn * insn, rtx new_addr),
+default_new_address_profitable_p)
+
 DEFHOOK
 (estimated_poly_value,
  "Return an estimate of the runtime value of @var{val}, for use in\n\
-things like cost calculations or profiling frequencies.  The default\n\
+things like cost calculations or profiling frequencies.  @var{kind} is used\n\
+to ask for the minimum, maximum, and likely estimates of the value through\n\
+the @code{POLY_VALUE_MIN}, @code{POLY_VALUE_MAX} and\n\
+@code{POLY_VALUE_LIKELY} values.  The default\n\
 implementation returns the lowest possible value of @var{val}.",
- HOST_WIDE_INT, (poly_int64 val),
+ HOST_WIDE_INT, (poly_int64 val, poly_value_estimate_kind kind),
  default_estimated_poly_value)
 
 /* Permit speculative instructions in delay slots during delayed-branch 
@@ -3801,7 +3968,8 @@ such as certain MIPS architectures possess both branches with and without\n\
 delay slots.  As the eager delay slot filler can decrease performance,\n\
 disabling it is beneficial when ordinary branches are available.  Use of\n\
 delay slot branches filled using the basic filler is often still desirable\n\
-as the delay slot can hide a pipeline bubble.", bool, (void),
+as the delay slot can hide a pipeline bubble.",
+  bool, (void),
   hook_bool_void_false)
 
 /* Return where to allocate pseudo for a given hard register initial value.  */
@@ -3893,7 +4061,7 @@ filling in a single size corresponding to each hard register;\n\
    at by the second argument should be set to -1.  */
 DEFHOOK
 (fixed_condition_code_regs,
- "On targets which do not use @code{(cc0)}, and which use a hard\n\
+ "On targets which use a hard\n\
 register rather than a pseudo-register to hold condition codes, the\n\
 regular CSE passes are often not able to identify cases in which the\n\
 hard register is set to a common value.  Use this hook to enable a\n\
@@ -4088,14 +4256,18 @@ DEFHOOK
  "This target hook may add @dfn{clobbers} to @var{clobbers} and\n\
 @var{clobbered_regs} for any hard regs the port wishes to automatically\n\
 clobber for an asm.  The @var{outputs} and @var{inputs} may be inspected\n\
-to avoid clobbering a register that is already used by the asm.\n\
-\n\
-It may modify the @var{outputs}, @var{inputs}, and @var{constraints}\n\
-as necessary for other pre-processing.  In this case the return value is\n\
-a sequence of insns to emit after the asm.",
+to avoid clobbering a register that is already used by the asm.  @var{loc}\n\
+is the source location of the asm.\n\
+\n\
+It may modify the @var{outputs}, @var{inputs}, @var{input_modes}, and\n\
+@var{constraints} as necessary for other pre-processing.  In this case the\n\
+return value is a sequence of insns to emit after the asm.  Note that\n\
+changes to @var{inputs} must be accompanied by the corresponding changes\n\
+to @var{input_modes}.",
  rtx_insn *,
- (vec<rtx>& outputs, vec<rtx>& inputs, vec<const char *>& constraints,
-  vec<rtx>& clobbers, HARD_REG_SET& clobbered_regs),
+ (vec<rtx>& outputs, vec<rtx>& inputs, vec<machine_mode>& input_modes,
+  vec<const char *>& constraints, vec<rtx>& clobbers,
+  HARD_REG_SET& clobbered_regs, location_t loc),
  NULL)
 
 /* This target hook allows the backend to specify a calling convention
@@ -4192,8 +4364,8 @@ normally defined in @file{libgcc2.c}.",
    protector runtime support.  */
 DEFHOOK
 (stack_protect_runtime_enabled_p,
- "Returns true if the target wants GCC's default stack protect runtime support,\
- otherwise return false.  The default implementation always returns true.",
+ "Returns true if the target wants GCC's default stack protect runtime support,\n\
+otherwise return false.  The default implementation always returns true.",
  bool, (void),
  hook_bool_void_true)
 
@@ -4246,6 +4418,39 @@ The default version of this hook returns false.",
  bool, (class loop *loop),
  default_predict_doloop_p)
 
+DEFHOOKPOD
+(have_count_reg_decr_p,
+ "Return true if the target supports hardware count register for decrement\n\
+and branch.\n\
+The default value is false.",
+ bool, false)
+
+DEFHOOKPOD
+(doloop_cost_for_generic,
+ "One IV candidate dedicated for doloop is introduced in IVOPTs, we can\n\
+calculate the computation cost of adopting it to any generic IV use by\n\
+function get_computation_cost as before.  But for targets which have\n\
+hardware count register support for decrement and branch, it may have to\n\
+move IV value from hardware count register to general purpose register\n\
+while doloop IV candidate is used for generic IV uses.  It probably takes\n\
+expensive penalty.  This hook allows target owners to define the cost for\n\
+this especially for generic IV uses.\n\
+The default value is zero.",
+ int64_t, 0)
+
+DEFHOOKPOD
+(doloop_cost_for_address,
+ "One IV candidate dedicated for doloop is introduced in IVOPTs, we can\n\
+calculate the computation cost of adopting it to any address IV use by\n\
+function get_computation_cost as before.  But for targets which have\n\
+hardware count register support for decrement and branch, it may have to\n\
+move IV value from hardware count register to general purpose register\n\
+while doloop IV candidate is used for address IV uses.  It probably takes\n\
+expensive penalty.  This hook allows target owners to define the cost for\n\
+this escpecially for address IV uses.\n\
+The default value is zero.",
+ int64_t, 0)
+
 DEFHOOK
 (can_use_doloop_p,
  "Return true if it is possible to use low-overhead loops (@code{doloop_end}\n\
@@ -4280,20 +4485,33 @@ loops containing function calls or branch on table instructions.",
  const char *, (const rtx_insn *insn),
  default_invalid_within_doloop)
 
+/* Returns the machine mode which the target prefers for doloop IV.  */
+DEFHOOK
+(preferred_doloop_mode,
+"This hook takes a @var{mode} for a doloop IV, where @code{mode} is the\n\
+original mode for the operation.  If the target prefers an alternate\n\
+@code{mode} for the operation, then this hook should return that mode;\n\
+otherwise the original @code{mode} should be returned.  For example, on a\n\
+64-bit target, @code{DImode} might be preferred over @code{SImode}.  Both the\n\
+original and the returned modes should be @code{MODE_INT}.",
+ machine_mode,
+ (machine_mode mode),
+ default_preferred_doloop_mode)
+
 /* Returns true for a legitimate combined insn.  */
 DEFHOOK
 (legitimate_combined_insn,
-"Take an instruction in @var{insn} and return @code{false} if the instruction\
- is not appropriate as a combination of two or more instructions.  The\
- default is to accept all instructions.",
+"Take an instruction in @var{insn} and return @code{false} if the instruction\n\
+is not appropriate as a combination of two or more instructions.  The\n\
+default is to accept all instructions.",
  bool, (rtx_insn *insn),
  hook_bool_rtx_insn_true)
 
 DEFHOOK
 (valid_dllimport_attribute_p,
-"@var{decl} is a variable or function with @code{__attribute__((dllimport))}\
- specified.  Use this hook if the target needs to add extra validation\
- checks to @code{handle_dll_attribute}.",
+"@var{decl} is a variable or function with @code{__attribute__((dllimport))}\n\
+specified.  Use this hook if the target needs to add extra validation\n\
+checks to @code{handle_dll_attribute}.",
  bool, (const_tree decl),
  hook_bool_const_tree_true)
 
@@ -4332,7 +4550,8 @@ DEFHOOK
 (asan_shadow_offset,
  "Return the offset bitwise ored into shifted address to get corresponding\n\
 Address Sanitizer shadow memory address.  NULL if Address Sanitizer is not\n\
-supported by the target.",
+supported by the target.  May return 0 if Address Sanitizer is not supported\n\
+by a subtarget.",
  unsigned HOST_WIDE_INT, (void),
  NULL)
 
@@ -4577,6 +4796,20 @@ Most ports do not need to implement anything for this hook.",
  void, (void),
  hook_void_void)
 
+DEFHOOK
+(push_argument,
+ "This target hook returns @code{true} if push instructions will be\n\
+used to pass outgoing arguments.  When the push instruction usage is\n\
+optional, @var{npush} is nonzero to indicate the number of bytes to\n\
+push.  Otherwise, @var{npush} is zero.  If the target machine does not\n\
+have a push instruction or push instruction should be avoided,\n\
+@code{false} should be returned.  That directs GCC to use an alternate\n\
+strategy: to allocate the entire argument block and then store the\n\
+arguments into it.  If this target hook may return @code{true},\n\
+@code{PUSH_ROUNDING} must be defined.",
+ bool, (unsigned int npush),
+ default_push_argument)
+
 DEFHOOK
 (strict_argument_naming,
  "Define this hook to return @code{true} if the location where a function\n\
@@ -4630,11 +4863,11 @@ false.",
    Need audit to verify that this is the case.  */
 DEFHOOK
 (must_pass_in_stack,
- "This target hook should return @code{true} if we should not pass @var{type}\n\
+ "This target hook should return @code{true} if we should not pass @var{arg}\n\
 solely in registers.  The file @file{expr.h} defines a\n\
 definition that is usually appropriate, refer to @file{expr.h} for additional\n\
 documentation.",
- bool, (machine_mode mode, const_tree type),
+ bool, (const function_arg_info &arg),
  must_pass_in_stack_var_size_or_pad)
 
 /* Return true if type TYPE, mode MODE, which is passed by reference,
@@ -4913,6 +5146,28 @@ If this hook is not defined, then FUNCTION_VALUE_REGNO_P will be used.",
  bool, (const unsigned int regno),
  default_function_value_regno_p)
 
+DEFHOOK
+(fntype_abi,
+ "Return the ABI used by a function with type @var{type}; see the\n\
+definition of @code{predefined_function_abi} for details of the ABI\n\
+descriptor.  Targets only need to define this hook if they support\n\
+interoperability between several ABIs in the same translation unit.",
+ const predefined_function_abi &, (const_tree type),
+ NULL)
+
+DEFHOOK
+(insn_callee_abi,
+ "This hook returns a description of the ABI used by the target of\n\
+call instruction @var{insn}; see the definition of\n\
+@code{predefined_function_abi} for details of the ABI descriptor.\n\
+Only the global function @code{insn_callee_abi} should call this hook\n\
+directly.\n\
+\n\
+Targets only need to define this hook if they support\n\
+interoperability between several ABIs in the same translation unit.",
+ const predefined_function_abi &, (const rtx_insn *insn),
+ NULL)
+
 /* ??? Documenting this hook requires a GFDL license grant.  */
 DEFHOOK_UNDOC
 (internal_arg_pointer,
@@ -4938,6 +5193,21 @@ argument list due to stack realignment.  Return @code{NULL} if no DRAP\n\
 is needed.",
  rtx, (void), NULL)
 
+/* Generate instruction sequence to zero call used registers.  */
+DEFHOOK
+(zero_call_used_regs,
+ "This target hook emits instructions to zero the subset of @var{selected_regs}\n\
+that could conceivably contain values that are useful to an attacker.\n\
+Return the set of registers that were actually cleared.\n\
+\n\
+The default implementation uses normal move instructions to zero\n\
+all the registers in @var{selected_regs}.  Define this hook if the\n\
+target has more efficient ways of zeroing certain registers,\n\
+or if you believe that certain registers would never contain\n\
+values that are useful to an attacker.",
+ HARD_REG_SET, (HARD_REG_SET selected_regs),
+default_zero_call_used_regs)
+
 /* Return true if all function parameters should be spilled to the
    stack.  */
 DEFHOOK
@@ -4996,12 +5266,28 @@ Note that the block move need only cover the constant parts of the\n\
 trampoline.  If the target isolates the variable parts of the trampoline\n\
 to the end, not all @code{TRAMPOLINE_SIZE} bytes need be copied.\n\
 \n\
-If the target requires any other actions, such as flushing caches or\n\
+If the target requires any other actions, such as flushing caches\n\
+(possibly calling function maybe_emit_call_builtin___clear_cache) or\n\
 enabling stack execution, these actions should be performed after\n\
 initializing the trampoline proper.",
  void, (rtx m_tramp, tree fndecl, rtx static_chain),
  default_trampoline_init)
 
+/* Emit a call to a function to clear the instruction cache.  */
+DEFHOOK
+(emit_call_builtin___clear_cache,
+ "On targets that do not define a @code{clear_cache} insn expander,\n\
+but that define the @code{CLEAR_CACHE_INSN} macro,\n\
+maybe_emit_call_builtin___clear_cache relies on this target hook\n\
+to clear an address range in the instruction cache.\n\
+\n\
+The default implementation calls the @code{__clear_cache} builtin,\n\
+taking the assembler name from the builtin declaration.  Overriding\n\
+definitions may call alternate functions, with alternate calling\n\
+conventions, or emit alternate RTX to perform the job.",
+ void, (rtx begin, rtx end),
+ default_emit_call_builtin___clear_cache)
+
 /* Adjust the address of the trampoline in a target-specific way.  */
 DEFHOOK
 (trampoline_adjust_address,
@@ -5031,7 +5317,7 @@ HPPA or IA-64.\n\
 \n\
 Using descriptors for nested functions\n\
 eliminates the need for trampolines that reside on the stack and require\n\
-it to be made executable.",\
+it to be made executable.",
  int, -1)
 
 /* Return the number of bytes of its own arguments that a function
@@ -5082,9 +5368,9 @@ number of arguments.",
    returned.  */
 DEFHOOK
 (get_raw_result_mode,
- "This target hook returns the mode to be used when accessing raw return\
- registers in @code{__builtin_return}.  Define this macro if the value\
- in @var{reg_raw_mode} is not correct.",
+ "This target hook returns the mode to be used when accessing raw return\n\
+registers in @code{__builtin_return}.  Define this macro if the value\n\
+in @var{reg_raw_mode} is not correct.",
  fixed_size_mode, (int regno),
  default_get_reg_raw_mode)
 
@@ -5092,9 +5378,9 @@ DEFHOOK
    passed.  */
 DEFHOOK
 (get_raw_arg_mode,
- "This target hook returns the mode to be used when accessing raw argument\
- registers in @code{__builtin_apply_args}.  Define this macro if the value\
- in @var{reg_raw_mode} is not correct.",
+ "This target hook returns the mode to be used when accessing raw argument\n\
+registers in @code{__builtin_apply_args}.  Define this macro if the value\n\
+in @var{reg_raw_mode} is not correct.",
  fixed_size_mode, (int regno),
  default_get_reg_raw_mode)
 
@@ -5190,6 +5476,22 @@ This is currently used only by the C and C++ front ends.",
  tree, (tree type, tree expr),
  hook_tree_tree_tree_null)
 
+DEFHOOK
+(verify_type_context,
+ "If defined, this hook returns false if there is a target-specific reason\n\
+why type @var{type} cannot be used in the source language context described\n\
+by @var{context}.  When @var{silent_p} is false, the hook also reports an\n\
+error against @var{loc} for invalid uses of @var{type}.\n\
+\n\
+Calls to this hook should be made through the global function\n\
+@code{verify_type_context}, which makes the @var{silent_p} parameter\n\
+default to false and also handles @code{error_mark_node}.\n\
+\n\
+The default implementation always returns true.",
+ bool, (location_t loc, type_context_kind context, const_tree type,
+       bool silent_p),
+ NULL)
+
 DEFHOOK
 (can_change_mode_class,
  "This hook returns true if it is possible to bitcast values held in\n\
@@ -5235,53 +5537,53 @@ DEFHOOK
 /* Return true if we use LRA instead of reload.  */
 DEFHOOK
 (lra_p,
- "A target hook which returns true if we use LRA instead of reload pass.\
-  \
-  The default version of this target hook returns true.  New ports\
-  should use LRA, and existing ports are encouraged to convert.",
+ "A target hook which returns true if we use LRA instead of reload pass.\n\
+\n\
+The default version of this target hook returns true.  New ports\n\
+should use LRA, and existing ports are encouraged to convert.",
  bool, (void),
  default_lra_p)
 
 /* Return register priority of given hard regno for the current target.  */
 DEFHOOK
 (register_priority,
- "A target hook which returns the register priority number to which the\
-  register @var{hard_regno} belongs to.  The bigger the number, the\
-  more preferable the hard register usage (when all other conditions are\
-  the same).  This hook can be used to prefer some hard register over\
-  others in LRA.  For example, some x86-64 register usage needs\
-  additional prefix which makes instructions longer.  The hook can\
-  return lower priority number for such registers make them less favorable\
-  and as result making the generated code smaller.\
-  \
-  The default version of this target hook returns always zero.",
+ "A target hook which returns the register priority number to which the\n\
+register @var{hard_regno} belongs to.  The bigger the number, the\n\
+more preferable the hard register usage (when all other conditions are\n\
+the same).  This hook can be used to prefer some hard register over\n\
+others in LRA.  For example, some x86-64 register usage needs\n\
+additional prefix which makes instructions longer.  The hook can\n\
+return lower priority number for such registers make them less favorable\n\
+and as result making the generated code smaller.\n\
+\n\
+The default version of this target hook returns always zero.",
  int, (int),
  default_register_priority)
 
 /* Return true if we need register usage leveling.  */
 DEFHOOK
 (register_usage_leveling_p,
- "A target hook which returns true if we need register usage leveling.\
-  That means if a few hard registers are equally good for the\
-  assignment, we choose the least used hard register.  The register\
-  usage leveling may be profitable for some targets.  Don't use the\
-  usage leveling for targets with conditional execution or targets\
-  with big register files as it hurts if-conversion and cross-jumping\
-  optimizations.\
-  \
-  The default version of this target hook returns always false.",
+ "A target hook which returns true if we need register usage leveling.\n\
+That means if a few hard registers are equally good for the\n\
+assignment, we choose the least used hard register.  The register\n\
+usage leveling may be profitable for some targets.  Don't use the\n\
+usage leveling for targets with conditional execution or targets\n\
+with big register files as it hurts if-conversion and cross-jumping\n\
+optimizations.\n\
+\n\
+The default version of this target hook returns always false.",
  bool, (void),
  default_register_usage_leveling_p)
 
 /* Return true if maximal address displacement can be different.  */
 DEFHOOK
 (different_addr_displacement_p,
- "A target hook which returns true if an address with the same structure\
-  can have different maximal legitimate displacement.  For example, the\
-  displacement can depend on memory mode or on operand combinations in\
-  the insn.\
-  \
-  The default version of this target hook returns always false.",
+ "A target hook which returns true if an address with the same structure\n\
+can have different maximal legitimate displacement.  For example, the\n\
+displacement can depend on memory mode or on operand combinations in\n\
+the insn.\n\
+\n\
+The default version of this target hook returns always false.",
  bool, (void),
  default_different_addr_displacement_p)
 
@@ -5289,32 +5591,32 @@ DEFHOOK
    instead of memory.  */
 DEFHOOK
 (spill_class,
- "This hook defines a class of registers which could be used for spilling\
-  pseudos of the given mode and class, or @code{NO_REGS} if only memory\
-  should be used.  Not defining this hook is equivalent to returning\
-  @code{NO_REGS} for all inputs.",
+ "This hook defines a class of registers which could be used for spilling\n\
+pseudos of the given mode and class, or @code{NO_REGS} if only memory\n\
+should be used.  Not defining this hook is equivalent to returning\n\
+@code{NO_REGS} for all inputs.",
  reg_class_t, (reg_class_t, machine_mode),
  NULL)
 
 /* Determine an additional allocno class.  */
 DEFHOOK
 (additional_allocno_class_p,
- "This hook should return @code{true} if given class of registers should\
-  be an allocno class in any way.  Usually RA uses only one register\
-  class from all classes containing the same register set.  In some\
-  complicated cases, you need to have two or more such classes as\
-  allocno ones for RA correct work.  Not defining this hook is\
-  equivalent to returning @code{false} for all inputs.",
+ "This hook should return @code{true} if given class of registers should\n\
+be an allocno class in any way.  Usually RA uses only one register\n\
+class from all classes containing the same register set.  In some\n\
+complicated cases, you need to have two or more such classes as\n\
+allocno ones for RA correct work.  Not defining this hook is\n\
+equivalent to returning @code{false} for all inputs.",
  bool, (reg_class_t),
  hook_bool_reg_class_t_false)
 
 DEFHOOK
 (cstore_mode,
- "This hook defines the machine mode to use for the boolean result of\
-  conditional store patterns.  The ICODE argument is the instruction code\
-  for the cstore being performed.  Not definiting this hook is the same\
-  as accepting the mode encoded into operand 0 of the cstore expander\
-  patterns.",
+ "This hook defines the machine mode to use for the boolean result of\n\
+conditional store patterns.  The ICODE argument is the instruction code\n\
+for the cstore being performed.  Not definiting this hook is the same\n\
+as accepting the mode encoded into operand 0 of the cstore expander\n\
+patterns.",
   scalar_int_mode, (enum insn_code icode),
   default_cstore_mode)
 
@@ -5322,10 +5624,10 @@ DEFHOOK
    classes to use.  */
 DEFHOOK
 (compute_pressure_classes,
- "A target hook which lets a backend compute the set of pressure classes to\
-  be used by those optimization passes which take register pressure into\
-  account, as opposed to letting IRA compute them.  It returns the number of\
-  register classes stored in the array @var{pressure_classes}.",
+ "A target hook which lets a backend compute the set of pressure classes to\n\
+be used by those optimization passes which take register pressure into\n\
+account, as opposed to letting IRA compute them.  It returns the number of\n\
+register classes stored in the array @var{pressure_classes}.",
  int, (enum reg_class *pressure_classes), NULL)
 
 /* True if a structure, union or array with MODE containing FIELD should
@@ -5349,7 +5651,7 @@ Normally, this is not needed.",
 DEFHOOK
 (expand_divmod_libfunc,
  "Define this hook for enabling divmod transform if the port does not have\n\
-hardware divmod insn but defines target-specific divmod libfuncs.", 
+hardware divmod insn but defines target-specific divmod libfuncs.",
  void, (rtx libfunc, machine_mode mode, rtx op0, rtx op1, rtx *quot, rtx *rem),
  NULL)
 
@@ -5589,16 +5891,16 @@ in words.",
 
 DEFHOOK
 (preferred_rename_class,
- "A target hook that places additional preference on the register\
- class to use when it is necessary to rename a register in class\
- @var{rclass} to another class, or perhaps @var{NO_REGS}, if no\
- preferred register class is found or hook @code{preferred_rename_class}\
- is not implemented.\
- Sometimes returning a more restrictive class makes better code.  For\
- example, on ARM, thumb-2 instructions using @code{LO_REGS} may be\
- smaller than instructions using @code{GENERIC_REGS}.  By returning\
- @code{LO_REGS} from @code{preferred_rename_class}, code size can\
- be reduced.",
+ "A target hook that places additional preference on the register\n\
+class to use when it is necessary to rename a register in class\n\
+@var{rclass} to another class, or perhaps @var{NO_REGS}, if no\n\
+preferred register class is found or hook @code{preferred_rename_class}\n\
+is not implemented.\n\
+Sometimes returning a more restrictive class makes better code.  For\n\
+example, on ARM, thumb-2 instructions using @code{LO_REGS} may be\n\
+smaller than instructions using @code{GENERIC_REGS}.  By returning\n\
+@code{LO_REGS} from @code{preferred_rename_class}, code size can\n\
+be reduced.",
  reg_class_t, (reg_class_t rclass),
  default_preferred_rename_class)
 
@@ -5762,32 +6064,27 @@ The default version of this hook always returns @code{true}.",
 
 DEFHOOK
 (hard_regno_call_part_clobbered,
- "This hook should return true if @var{regno} is partly call-saved and\n\
-partly call-clobbered, and if a value of mode @var{mode} would be partly\n\
-clobbered by call instruction @var{insn}.  If @var{insn} is NULL then it\n\
-should return true if any call could partly clobber the register.\n\
-For example, if the low 32 bits of @var{regno} are preserved across a call\n\
-but higher bits are clobbered, this hook should return true for a 64-bit\n\
-mode but false for a 32-bit mode.\n\
+ "ABIs usually specify that calls must preserve the full contents\n\
+of a particular register, or that calls can alter any part of a\n\
+particular register.  This information is captured by the target macro\n\
+@code{CALL_REALLY_USED_REGISTERS}.  However, some ABIs specify that calls\n\
+must preserve certain bits of a particular register but can alter others.\n\
+This hook should return true if this applies to at least one of the\n\
+registers in @samp{(reg:@var{mode} @var{regno})}, and if as a result the\n\
+call would alter part of the @var{mode} value.  For example, if a call\n\
+preserves the low 32 bits of a 64-bit hard register @var{regno} but can\n\
+clobber the upper 32 bits, this hook should return true for a 64-bit mode\n\
+but false for a 32-bit mode.\n\
+\n\
+The value of @var{abi_id} comes from the @code{predefined_function_abi}\n\
+structure that describes the ABI of the call; see the definition of the\n\
+structure for more details.  If (as is usual) the target uses the same ABI\n\
+for all functions in a translation unit, @var{abi_id} is always 0.\n\
 \n\
 The default implementation returns false, which is correct\n\
 for targets that don't have partly call-clobbered registers.",
- bool, (rtx_insn *insn, unsigned int regno, machine_mode mode),
- hook_bool_insn_uint_mode_false)
-
-DEFHOOK
-(return_call_with_max_clobbers,
- "This hook returns a pointer to the call that partially clobbers the\n\
-most registers.  If a platform supports multiple ABIs where the registers\n\
-that are partially clobbered may vary, this function compares two\n\
-calls and returns a pointer to the one that clobbers the most registers.\n\
-If both calls clobber the same registers, @var{call_1} must be returned.\n\
-\n\
-The registers clobbered in different ABIs must be a proper subset or\n\
-superset of all other ABIs.  @var{call_1} must always be a call insn,\n\
-call_2 may be NULL or a call insn.",
- rtx_insn *, (rtx_insn *call_1, rtx_insn *call_2),
- NULL)
+ bool, (unsigned int abi_id, unsigned int regno, machine_mode mode),
+ hook_bool_uint_uint_mode_false)
 
 DEFHOOK
 (get_multilib_abi_name,
@@ -5795,20 +6092,6 @@ DEFHOOK
  const char *, (void),
  hook_constcharptr_void_null)
 
-DEFHOOK
-(remove_extra_call_preserved_regs,
- "This hook removes registers from the set of call-clobbered registers\n\
- in @var{used_regs} if, contrary to the default rules, something guarantees\n\
- that @samp{insn} preserves those registers.  For example, some targets\n\
- support variant ABIs in which functions preserve more registers than\n\
- normal functions would.  Removing those extra registers from @var{used_regs}\n\
- can lead to better register allocation.\n\
- \n\
- The default implementation does nothing, which is always safe.\n\
- Defining the hook is purely an optimization.",
- void, (rtx_insn *insn, HARD_REG_SET *used_regs),
- default_remove_extra_call_preserved_regs)
-
 /* Return the smallest number of different values for which it is best to
    use a jump-table instead of a tree of conditional branches.  */
 DEFHOOK
@@ -5923,11 +6206,11 @@ these registers when the target switches are opposed to them.)",
 DEFHOOK
 (stack_clash_protection_alloca_probe_range,
  "Some targets have an ABI defined interval for which no probing needs to be done.\n\
-When a probe does need to be done this same interval is used as the probe distance \
+When a probe does need to be done this same interval is used as the probe distance\n\
 up when doing stack clash protection for alloca.\n\
 On such targets this value can be set to override the default probing up interval.\n\
-Define this variable to return nonzero if such a probe range is required or zero otherwise.  \
-Defining this hook also requires your functions which make use of alloca to have at least 8 byes\
+Define this variable to return nonzero if such a probe range is required or zero otherwise.\n\
+Defining this hook also requires your functions which make use of alloca to have at least 8 byes\n\
 of outgoing arguments.  If this is not the case the stack will be corrupted.\n\
 You need not define this macro if it would always have the value zero.",
  HOST_WIDE_INT, (void),
@@ -5949,22 +6232,25 @@ DEFHOOK_UNDOC
 
 DEFHOOK
 (excess_precision,
- "Return a value, with the same meaning as the C99 macro\
- @code{FLT_EVAL_METHOD} that describes which excess precision should be\
- applied.  @var{type} is either @code{EXCESS_PRECISION_TYPE_IMPLICIT},\
- @code{EXCESS_PRECISION_TYPE_FAST}, or\
- @code{EXCESS_PRECISION_TYPE_STANDARD}.  For\
- @code{EXCESS_PRECISION_TYPE_IMPLICIT}, the target should return which\
- precision and range operations will be implictly evaluated in regardless\
- of the excess precision explicitly added.  For\
- @code{EXCESS_PRECISION_TYPE_STANDARD} and\
- @code{EXCESS_PRECISION_TYPE_FAST}, the target should return the\
- explicit excess precision that should be added depending on the\
- value set for @option{-fexcess-precision=@r{[}standard@r{|}fast@r{]}}.\
- Note that unpredictable explicit excess precision does not make sense,\
- so a target should never return @code{FLT_EVAL_METHOD_UNPREDICTABLE}\
- when @var{type} is @code{EXCESS_PRECISION_TYPE_STANDARD} or\
- @code{EXCESS_PRECISION_TYPE_FAST}.",
+ "Return a value, with the same meaning as the C99 macro\n\
+@code{FLT_EVAL_METHOD} that describes which excess precision should be\n\
+applied.  @var{type} is either @code{EXCESS_PRECISION_TYPE_IMPLICIT},\n\
+@code{EXCESS_PRECISION_TYPE_FAST},\n\
+@code{EXCESS_PRECISION_TYPE_STANDARD}, or\n\
+@code{EXCESS_PRECISION_TYPE_FLOAT16}.  For\n\
+@code{EXCESS_PRECISION_TYPE_IMPLICIT}, the target should return which\n\
+precision and range operations will be implictly evaluated in regardless\n\
+of the excess precision explicitly added.  For\n\
+@code{EXCESS_PRECISION_TYPE_STANDARD}, \n\
+@code{EXCESS_PRECISION_TYPE_FLOAT16}, and\n\
+@code{EXCESS_PRECISION_TYPE_FAST}, the target should return the\n\
+explicit excess precision that should be added depending on the\n\
+value set for @option{-fexcess-precision=@r{[}standard@r{|}fast@r{]}}.\n\
+Note that unpredictable explicit excess precision does not make sense,\n\
+so a target should never return @code{FLT_EVAL_METHOD_UNPREDICTABLE}\n\
+when @var{type} is @code{EXCESS_PRECISION_TYPE_STANDARD},\n\
+@code{EXCESS_PRECISION_TYPE_FLOAT16} or\n\
+@code{EXCESS_PRECISION_TYPE_FAST}.",
  enum flt_eval_method, (enum excess_precision_type type),
  default_excess_precision)
 
@@ -6050,12 +6336,12 @@ method.  The default is to return @code{true}.",
 
 DEFHOOK
 (determine_class_data_visibility,
-"@var{decl} is a virtual table, virtual table table, typeinfo object,\
- or other similar implicit class data object that will be emitted with\
- external linkage in this translation unit.  No ELF visibility has been\
- explicitly specified.  If the target needs to specify a visibility\
- other than that of the containing class, use this hook to set\
- @code{DECL_VISIBILITY} and @code{DECL_VISIBILITY_SPECIFIED}.",
+"@var{decl} is a virtual table, virtual table table, typeinfo object,\n\
+or other similar implicit class data object that will be emitted with\n\
+external linkage in this translation unit.  No ELF visibility has been\n\
+explicitly specified.  If the target needs to specify a visibility\n\
+other than that of the containing class, use this hook to set\n\
+@code{DECL_VISIBILITY} and @code{DECL_VISIBILITY_SPECIFIED}.",
  void, (tree decl),
  hook_void_tree)
 
@@ -6109,9 +6395,9 @@ unloaded. The default is to return false.",
 
 DEFHOOK
 (adjust_class_at_definition,
-"@var{type} is a C++ class (i.e., RECORD_TYPE or UNION_TYPE) that has just\
- been defined.  Use this hook to make adjustments to the class (eg, tweak\
- visibility or perform any other required target modifications).",
+"@var{type} is a C++ class (i.e., RECORD_TYPE or UNION_TYPE) that has just\n\
+been defined.  Use this hook to make adjustments to the class (eg, tweak\n\
+visibility or perform any other required target modifications).",
  void, (tree type),
  hook_void_tree)
 
@@ -6240,7 +6526,8 @@ DEFHOOK
 in the @code{struct cl_target_option} structure for function-specific\n\
 options from the @code{struct gcc_options} structure.\n\
 @xref{Option file format}.",
- void, (struct cl_target_option *ptr, struct gcc_options *opts), NULL)
+ void, (struct cl_target_option *ptr, struct gcc_options *opts,
+       struct gcc_options *opts_set), NULL)
 
 /* Function to restore any extra target state from the target options
    structure.  */
@@ -6249,7 +6536,8 @@ DEFHOOK
  "This hook is called to restore any additional target-specific\n\
 information in the @code{struct cl_target_option} structure for\n\
 function-specific options to the @code{struct gcc_options} structure.",
- void, (struct gcc_options *opts, struct cl_target_option *ptr), NULL)
+ void, (struct gcc_options *opts, struct gcc_options *opts_set,
+       struct cl_target_option *ptr), NULL)
 
 /* Function to update target-specific option information after being
    streamed in.  */
@@ -6327,7 +6615,9 @@ specific target options and the caller does not use the same options.",
 
 DEFHOOK
 (relayout_function,
-"This target hook fixes function @var{fndecl} after attributes are processed. Default does nothing. On ARM, the default function's alignment is updated with the attribute target.",
+"This target hook fixes function @var{fndecl} after attributes are processed.\n\
+Default does nothing. On ARM, the default function's alignment is updated\n\
+with the attribute target.",
  void, (tree fndecl),
  hook_void_tree)
 
@@ -6366,8 +6656,8 @@ is to enable the fipa-ra optimization.",
 /* Fill in additional registers set up by prologue into a regset.  */
 DEFHOOK
 (set_up_by_prologue,
- "This hook should add additional registers that are computed by the prologue\
- to the hard regset for shrink-wrapping optimization purposes.",
+ "This hook should add additional registers that are computed by the prologue\n\
+to the hard regset for shrink-wrapping optimization purposes.",
  void, (struct hard_reg_set_container *),
  NULL)
 
@@ -6376,7 +6666,9 @@ DEFHOOK
    function attribute.  */
 DEFHOOK
 (warn_func_return,
- "True if a function's return statements should be checked for matching the function's return type.  This includes checking for falling off the end of a non-void function.  Return false if no such check should be made.",
+ "True if a function's return statements should be checked for matching\n\
+the function's return type.  This includes checking for falling off the end\n\
+of a non-void function.  Return false if no such check should be made.",
  bool, (tree),
  hook_bool_tree_true)
 
@@ -6454,8 +6746,8 @@ This will suppress generation of the normal debug frame unwind information.",
  default_debug_unwind_info)
 
 DEFHOOK
-(reset_location_view, "\
-This hook, if defined, enables -ginternal-reset-location-views, and\n\
+(reset_location_view,
+ "This hook, if defined, enables -ginternal-reset-location-views, and\n\
 uses its result to override cases in which the estimated min insn\n\
 length might be nonzero even when a PC advance (i.e., a view reset)\n\
 cannot be taken for granted.\n\
@@ -6516,9 +6808,9 @@ defined to 1.",
 
 DEFHOOKPOD
 (atomic_test_and_set_trueval,
- "This value should be set if the result written by\
- @code{atomic_test_and_set} is not exactly 1, i.e.@: the\
- @code{bool} @code{true}.",
+ "This value should be set if the result written by\n\
+@code{atomic_test_and_set} is not exactly 1, i.e.@: the\n\
+@code{bool} @code{true}.",
  unsigned char, 1)
 
 /* Return an unsigned int representing the alignment (in bits) of the atomic
@@ -6526,29 +6818,29 @@ DEFHOOKPOD
    as needed.  */
 DEFHOOK
 (atomic_align_for_mode,
-"If defined, this function returns an appropriate alignment in bits for an\
- atomic object of machine_mode @var{mode}.  If 0 is returned then the\
- default alignment for the specified mode is used. ",
+"If defined, this function returns an appropriate alignment in bits for an\n\
+atomic object of machine_mode @var{mode}.  If 0 is returned then the\n\
+default alignment for the specified mode is used.",
  unsigned int, (machine_mode mode),
  hook_uint_mode_0)
 
 DEFHOOK
 (atomic_assign_expand_fenv,
-"ISO C11 requires atomic compound assignments that may raise floating-point\
- exceptions to raise exceptions corresponding to the arithmetic operation\
- whose result was successfully stored in a compare-and-exchange sequence. \
- This requires code equivalent to calls to @code{feholdexcept},\
- @code{feclearexcept} and @code{feupdateenv} to be generated at\
- appropriate points in the compare-and-exchange sequence.  This hook should\
- set @code{*@var{hold}} to an expression equivalent to the call to\
- @code{feholdexcept}, @code{*@var{clear}} to an expression equivalent to\
- the call to @code{feclearexcept} and @code{*@var{update}} to an expression\
- equivalent to the call to @code{feupdateenv}.  The three expressions are\
- @code{NULL_TREE} on entry to the hook and may be left as @code{NULL_TREE}\
- if no code is required in a particular place.  The default implementation\
- leaves all three expressions as @code{NULL_TREE}.  The\
- @code{__atomic_feraiseexcept} function from @code{libatomic} may be of use\
- as part of the code generated in @code{*@var{update}}.",
+"ISO C11 requires atomic compound assignments that may raise floating-point\n\
+exceptions to raise exceptions corresponding to the arithmetic operation\n\
+whose result was successfully stored in a compare-and-exchange sequence.\n\
+This requires code equivalent to calls to @code{feholdexcept},\n\
+@code{feclearexcept} and @code{feupdateenv} to be generated at\n\
+appropriate points in the compare-and-exchange sequence.  This hook should\n\
+set @code{*@var{hold}} to an expression equivalent to the call to\n\
+@code{feholdexcept}, @code{*@var{clear}} to an expression equivalent to\n\
+the call to @code{feclearexcept} and @code{*@var{update}} to an expression\n\
+equivalent to the call to @code{feupdateenv}.  The three expressions are\n\
+@code{NULL_TREE} on entry to the hook and may be left as @code{NULL_TREE}\n\
+if no code is required in a particular place.  The default implementation\n\
+leaves all three expressions as @code{NULL_TREE}.  The\n\
+@code{__atomic_feraiseexcept} function from @code{libatomic} may be of use\n\
+as part of the code generated in @code{*@var{update}}.",
  void, (tree *hold, tree *clear, tree *update),
  default_atomic_assign_expand_fenv)
 
@@ -6633,23 +6925,26 @@ running a cleanup.  The default is @code{false}.",
 
 DEFHOOKPOD
 (want_debug_pub_sections,
- "True if the @code{.debug_pubtypes} and @code{.debug_pubnames} sections\
- should be emitted.  These sections are not used on most platforms, and\
- in particular GDB does not use them.",
+ "True if the @code{.debug_pubtypes} and @code{.debug_pubnames} sections\n\
+should be emitted.  These sections are not used on most platforms, and\n\
+in particular GDB does not use them.",
  bool, false)
 
 DEFHOOKPOD
-(delay_sched2, "True if sched2 is not to be run at its normal place.\n\
+(delay_sched2,
+ "True if sched2 is not to be run at its normal place.\n\
 This usually means it will be run as part of machine-specific reorg.",
 bool, false)
 
 DEFHOOKPOD
-(delay_vartrack, "True if vartrack is not to be run at its normal place.\n\
+(delay_vartrack,
+ "True if vartrack is not to be run at its normal place.\n\
 This usually means it will be run as part of machine-specific reorg.",
 bool, false)
 
 DEFHOOKPOD
-(no_register_allocation, "True if register allocation and the passes\n\
+(no_register_allocation,
+ "True if register allocation and the passes\n\
 following it should not be run.  Usually true only for virtual assembler\n\
 targets.",
 bool, false)
@@ -6663,36 +6958,141 @@ HOOK_VECTOR (TARGET_TOGGLE_, mode_switching)
 
 DEFHOOK
 (emit,
- "Generate one or more insns to set @var{entity} to @var{mode}. @var{hard_reg_live} is the set of hard registers live at the point where the insn(s) are to be inserted. @var{prev_moxde} indicates the mode to switch from. Sets of a lower numbered entity will be emitted before sets of a higher numbered entity to a mode of the same or lower priority.",
+ "Generate one or more insns to set @var{entity} to @var{mode}.\n\
+@var{hard_reg_live} is the set of hard registers live at the point where\n\
+the insn(s) are to be inserted. @var{prev_moxde} indicates the mode\n\
+to switch from. Sets of a lower numbered entity will be emitted before\n\
+sets of a higher numbered entity to a mode of the same or lower priority.",
  void, (int entity, int mode, int prev_mode, HARD_REG_SET regs_live), NULL)
 
 DEFHOOK
 (needed,
- "@var{entity} is an integer specifying a mode-switched entity.  If @code{OPTIMIZE_MODE_SWITCHING} is defined, you must define this macro to return an integer value not larger than the corresponding element in @code{NUM_MODES_FOR_MODE_SWITCHING}, to denote the mode that @var{entity} must be switched into prior to the execution of @var{insn}.",
+ "@var{entity} is an integer specifying a mode-switched entity.\n\
+If @code{OPTIMIZE_MODE_SWITCHING} is defined, you must define this macro\n\
+to return an integer value not larger than the corresponding element\n\
+in @code{NUM_MODES_FOR_MODE_SWITCHING}, to denote the mode that @var{entity}\n\
+must be switched into prior to the execution of @var{insn}.",
  int, (int entity, rtx_insn *insn), NULL)
 
 DEFHOOK
 (after,
- "@var{entity} is an integer specifying a mode-switched entity.  If this macro is defined, it is evaluated for every @var{insn} during mode switching.  It determines the mode that an insn results in (if different from the incoming mode).",
+ "@var{entity} is an integer specifying a mode-switched entity.\n\
+If this macro is defined, it is evaluated for every @var{insn} during mode\n\
+switching.  It determines the mode that an insn results\n\
+in (if different from the incoming mode).",
  int, (int entity, int mode, rtx_insn *insn), NULL)
 
 DEFHOOK
 (entry,
- "If this macro is defined, it is evaluated for every @var{entity} that needs mode switching.  It should evaluate to an integer, which is a mode that @var{entity} is assumed to be switched to at function entry.  If @code{TARGET_MODE_ENTRY} is defined then @code{TARGET_MODE_EXIT} must be defined.",
+ "If this macro is defined, it is evaluated for every @var{entity} that\n\
+needs mode switching.  It should evaluate to an integer, which is a mode\n\
+that @var{entity} is assumed to be switched to at function entry.\n\
+If @code{TARGET_MODE_ENTRY} is defined then @code{TARGET_MODE_EXIT}\n\
+must be defined.",
  int, (int entity), NULL)
 
 DEFHOOK
 (exit,
- "If this macro is defined, it is evaluated for every @var{entity} that needs mode switching.  It should evaluate to an integer, which is a mode that @var{entity} is assumed to be switched to at function exit.  If @code{TARGET_MODE_EXIT} is defined then @code{TARGET_MODE_ENTRY} must be defined.",
+ "If this macro is defined, it is evaluated for every @var{entity} that\n\
+needs mode switching.  It should evaluate to an integer, which is a mode\n\
+that @var{entity} is assumed to be switched to at function exit.\n\
+If @code{TARGET_MODE_EXIT} is defined then @code{TARGET_MODE_ENTRY}\n\
+must be defined.",
  int, (int entity), NULL)
 
 DEFHOOK
 (priority,
- "This macro specifies the order in which modes for @var{entity} are processed. 0 is the highest priority, @code{NUM_MODES_FOR_MODE_SWITCHING[@var{entity}] - 1} the lowest.  The value of the macro should be an integer designating a mode for @var{entity}.  For any fixed @var{entity}, @code{mode_priority} (@var{entity}, @var{n}) shall be a bijection in 0 @dots{} @code{num_modes_for_mode_switching[@var{entity}] - 1}.",
+ "This macro specifies the order in which modes for @var{entity}\n\
+are processed. 0 is the highest priority,\n\
+@code{NUM_MODES_FOR_MODE_SWITCHING[@var{entity}] - 1} the lowest.\n\
+The value of the macro should be an integer designating a mode\n\
+for @var{entity}.  For any fixed @var{entity}, @code{mode_priority}\n\
+(@var{entity}, @var{n}) shall be a bijection in 0 @dots{}\n\
+@code{num_modes_for_mode_switching[@var{entity}] - 1}.",
  int, (int entity, int n), NULL)
 
 HOOK_VECTOR_END (mode_switching)
 
+#undef HOOK_PREFIX
+#define HOOK_PREFIX "TARGET_MEMTAG_"
+HOOK_VECTOR (TARGET_MEMTAG_, memtag)
+
+DEFHOOK
+(can_tag_addresses,
+ "True if the backend architecture naturally supports ignoring some region\n\
+of pointers.  This feature means that @option{-fsanitize=hwaddress} can\n\
+work.\n\
+\n\
+At preset, this feature does not support address spaces.  It also requires\n\
+@code{Pmode} to be the same as @code{ptr_mode}.",
+ bool, (), default_memtag_can_tag_addresses)
+
+DEFHOOK
+(tag_size,
+ "Return the size of a tag (in bits) for this platform.\n\
+\n\
+The default returns 8.",
+  uint8_t, (), default_memtag_tag_size)
+
+DEFHOOK
+(granule_size,
+ "Return the size in real memory that each byte in shadow memory refers to.\n\
+I.e. if a variable is @var{X} bytes long in memory, then this hook should\n\
+return the value @var{Y} such that the tag in shadow memory spans\n\
+@var{X}/@var{Y} bytes.\n\
+\n\
+Most variables will need to be aligned to this amount since two variables\n\
+that are neighbors in memory and share a tag granule would need to share\n\
+the same tag.\n\
+\n\
+The default returns 16.",
+  uint8_t, (), default_memtag_granule_size)
+
+DEFHOOK
+(insert_random_tag,
+ "Return an RTX representing the value of @var{untagged} but with a\n\
+(possibly) random tag in it.\n\
+Put that value into @var{target} if it is convenient to do so.\n\
+This function is used to generate a tagged base for the current stack frame.",
+  rtx, (rtx untagged, rtx target), default_memtag_insert_random_tag)
+
+DEFHOOK
+(add_tag,
+ "Return an RTX that represents the result of adding @var{addr_offset} to\n\
+the address in pointer @var{base} and @var{tag_offset} to the tag in pointer\n\
+@var{base}.\n\
+The resulting RTX must either be a valid memory address or be able to get\n\
+put into an operand with @code{force_operand}.\n\
+\n\
+Unlike other memtag hooks, this must return an expression and not emit any\n\
+RTL.",
+  rtx, (rtx base, poly_int64 addr_offset, uint8_t tag_offset),
+  default_memtag_add_tag)
+
+DEFHOOK
+(set_tag,
+ "Return an RTX representing @var{untagged_base} but with the tag @var{tag}.\n\
+Try and store this in @var{target} if convenient.\n\
+@var{untagged_base} is required to have a zero tag when this hook is called.\n\
+The default of this hook is to set the top byte of @var{untagged_base} to\n\
+@var{tag}.",
+  rtx, (rtx untagged_base, rtx tag, rtx target), default_memtag_set_tag)
+
+DEFHOOK
+(extract_tag,
+ "Return an RTX representing the tag stored in @var{tagged_pointer}.\n\
+Store the result in @var{target} if it is convenient.\n\
+The default represents the top byte of the original pointer.",
+  rtx, (rtx tagged_pointer, rtx target), default_memtag_extract_tag)
+
+DEFHOOK
+(untagged_pointer,
+ "Return an RTX representing @var{tagged_pointer} with its tag set to zero.\n\
+Store the result in @var{target} if convenient.\n\
+The default clears the top byte of the original pointer.",
+  rtx, (rtx tagged_pointer, rtx target), default_memtag_untagged_pointer)
+
+HOOK_VECTOR_END (memtag)
 #undef HOOK_PREFIX
 #define HOOK_PREFIX "TARGET_"
 
@@ -6717,6 +7117,18 @@ DEFHOOK
  void, (void),
  NULL)
 
+DEFHOOK
+(gcov_type_size,
+ "Returns the gcov type size in bits.  This type is used for example for\n\
+counters incremented by profiling and code-coverage events.  The default\n\
+value is 64, if the type size of long long is greater than 32, otherwise the\n\
+default value is 32.  A 64-bit type is recommended to avoid overflows of the\n\
+counters.  If the @option{-fprofile-update=atomic} is used, then the\n\
+counters are incremented using atomic operations.  Targets not supporting\n\
+64-bit atomic operations may override the default value and request a 32-bit\n\
+type.",
+ HOST_WIDE_INT, (void), default_gcov_type_size)
+
 /* Close the 'struct gcc_target' definition.  */
 HOOK_VECTOR_END (C90_EMPTY_HACK)