]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/target.def
Correct a function pre/postcondition [PR102403].
[thirdparty/gcc.git] / gcc / target.def
index f8d26e63021c498187603ff4c3f95ea10de58bae..c5d90cace80d75ef17cd5eddf657db8334f786de 100644 (file)
@@ -1,5 +1,5 @@
 /* Target hook definitions.
-   Copyright (C) 2001-2020 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)
 
@@ -1734,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.  */
@@ -1826,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)
 
@@ -1837,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\
@@ -2007,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
@@ -2022,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,
  (class vec_info *, void *data, int count, enum vect_cost_for_stmt kind,
-  class _stmt_vec_info *stmt_info, int misalign,
+  class _stmt_vec_info *stmt_info, tree vectype, int misalign,
   enum vect_cost_model_location where),
  default_add_stmt_cost)
 
@@ -2039,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),
@@ -2051,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)
@@ -2325,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)
 
@@ -2618,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
@@ -2651,11 +2701,11 @@ 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)
 
@@ -2697,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,
@@ -2720,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,
@@ -3025,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)
 
@@ -3148,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\
@@ -3191,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\
@@ -3218,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)
 
@@ -3348,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\
@@ -3626,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\
@@ -3847,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 
@@ -3865,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.  */
@@ -3957,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\
@@ -4152,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
@@ -4256,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)
 
@@ -4377,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)
 
@@ -4429,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)
 
@@ -4674,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\
@@ -5057,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
@@ -5115,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,
@@ -5150,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
@@ -5201,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)
 
@@ -5211,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)
 
@@ -5370,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)
 
@@ -5424,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)
 
@@ -5457,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
@@ -5484,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)
 
@@ -5724,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)
 
@@ -6039,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),
@@ -6065,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)
 
@@ -6166,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)
 
@@ -6225,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)
 
@@ -6356,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.  */
@@ -6365,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.  */
@@ -6443,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)
 
@@ -6482,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)
 
@@ -6492,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)
 
@@ -6570,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\
@@ -6632,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
@@ -6642,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)
 
@@ -6749,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)
@@ -6779,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_"
 
@@ -6833,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)