public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/sphinx-v1)] Add hook placeholders for target macros.
@ 2021-06-22 14:54 Martin Liska
  0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2021-06-22 14:54 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:2c503c8077d3cd7f291b17ea3aa0548cc081abae

commit 2c503c8077d3cd7f291b17ea3aa0548cc081abae
Author: Martin Liska <mliska@suse.cz>
Date:   Tue Jun 22 15:34:36 2021 +0200

    Add hook placeholders for target macros.

Diff:
---
 .../adding-support-for-named-address-spaces.rst    |  42 ++-
 .../addressing-modes.rst                           | 174 ++++++++++++-
 .../adjusting-the-instruction-scheduler.rst        | 190 +++++++++++++-
 .../anchored-addresses.rst                         |  18 +-
 .../c++-abi-parameters.rst                         |  58 ++++-
 .../condition-code-status.rst                      |  18 +-
 .../controlling-debugging-information-format.rst   |  32 +++
 .../controlling-the-compilation-driver-gcc.rst     |   4 +
 .../d-abi-parameters.rst                           |  38 ++-
 .../defining-target-specific-uses-of-attribute.rst |  82 +++++-
 .../assembler-commands-for-exception-regions.rst   |  34 ++-
 .../macros-controlling-initialization-routines.rst |  12 +
 .../output-and-generation-of-labels.rst            |  36 +++
 .../output-of-assembler-instructions.rst           |   4 +
 .../output-of-data.rst                             |  46 ++--
 .../output-of-dispatch-tables.rst                  |  34 ++-
 .../the-overall-framework-of-an-assembler-file.rst |  74 +++++-
 .../describing-relative-costs-of-operations.rst    |  62 ++++-
 ...ividing-the-output-into-sections-texts-data.rst |  72 +++++-
 .../emulating-tls.rst                              |  42 ++-
 .../implementing-the-varargs-macros.rst            |  42 ++-
 .../implicit-calls-to-library-routines.rst         |  16 ++
 .../layout-of-source-language-data-types.rst       |   4 +
 .../miscellaneous-parameters.rst                   | 284 ++++++++++++++++++++-
 .../mode-switching-instructions.rst                |  26 +-
 ...rs-for-precompiled-header-validity-checking.rst |  18 +-
 .../register-classes.rst                           | 107 +++++++-
 .../register-usage.rst                             |  36 +++
 .../run-time-target-specification.rst              |  50 +++-
 .../basic-stack-layout.rst                         |  16 ++
 .../eliminating-frame-pointer-and-arg-pointer.rst  |  14 +-
 .../function-entry-and-exit.rst                    |  30 ++-
 .../generating-code-for-profiling.rst              |   6 +-
 .../how-large-values-are-returned.rst              |  26 +-
 .../how-scalar-function-values-are-returned.rst    |  22 +-
 .../miscellaneous-register-hooks.rst               |   6 +-
 .../passing-arguments-in-registers.rst             | 126 ++++++++-
 .../passing-function-arguments-on-the-stack.rst    |  15 +-
 .../permitting-tail-calls.rst                      |  18 +-
 .../registers-that-address-the-stack-frame.rst     |   4 +
 .../shrink-wrapping-separate-components.rst        |  26 +-
 .../specifying-how-stack-checking-is-done.rst      |   6 +-
 .../stack-smashing-protection.rst                  |  22 +-
 .../storage-layout.rst                             |  78 +++++-
 .../support-for-nested-functions.rst               |  20 ++
 45 files changed, 2023 insertions(+), 67 deletions(-)

diff --git a/gcc/doc/gccint/target-description-macros-and-functions/adding-support-for-named-address-spaces.rst b/gcc/doc/gccint/target-description-macros-and-functions/adding-support-for-named-address-spaces.rst
index 2810d244b88..b0a6b6bff66 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/adding-support-for-named-address-spaces.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/adding-support-for-named-address-spaces.rst
@@ -47,18 +47,28 @@ named address space #1:
 
 .. function:: scalar_int_mode TARGET_ADDR_SPACE_POINTER_MODE (addr_space_t address_space)
 
+  .. hook-start:TARGET_ADDR_SPACE_POINTER_MODE
+
   Define this to return the machine mode to use for pointers to
   :samp:`{address_space}` if the target supports named address spaces.
   The default version of this hook returns ``ptr_mode``.
 
+.. hook-end
+
 .. function:: scalar_int_mode TARGET_ADDR_SPACE_ADDRESS_MODE (addr_space_t address_space)
 
+  .. hook-start:TARGET_ADDR_SPACE_ADDRESS_MODE
+
   Define this to return the machine mode to use for addresses in
   :samp:`{address_space}` if the target supports named address spaces.
   The default version of this hook returns ``Pmode``.
 
+.. hook-end
+
 .. function:: bool TARGET_ADDR_SPACE_VALID_POINTER_MODE (scalar_int_mode mode, addr_space_t as)
 
+  .. hook-start:TARGET_ADDR_SPACE_VALID_POINTER_MODE
+
   Define this to return nonzero if the port can handle pointers
   with machine mode :samp:`{mode}` to address space :samp:`{as}`.  This target
   hook is the same as the ``TARGET_VALID_POINTER_MODE`` target hook,
@@ -67,8 +77,12 @@ named address space #1:
   ``TARGET_ADDR_SPACE_POINTER_MODE`` or ``TARGET_ADDR_SPACE_ADDRESS_MODE``
   target hooks for the given address space.
 
+.. hook-end
+
 .. function:: bool TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P (machine_mode mode, rtx exp, bool strict, addr_space_t as)
 
+  .. hook-start:TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P
+
   Define this to return true if :samp:`{exp}` is a valid address for mode
   :samp:`{mode}` in the named address space :samp:`{as}`.  The :samp:`{strict}`
   parameter says whether strict addressing is in effect after reload has
@@ -76,15 +90,23 @@ named address space #1:
   ``TARGET_LEGITIMATE_ADDRESS_P`` target hook, except that it includes
   explicit named address space support.
 
+.. hook-end
+
 .. function:: rtx TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS (rtx x, rtx oldx, machine_mode mode, addr_space_t as)
 
+  .. hook-start:TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS
+
   Define this to modify an invalid address :samp:`{x}` to be a valid address
   with mode :samp:`{mode}` in the named address space :samp:`{as}`.  This target
   hook is the same as the ``TARGET_LEGITIMIZE_ADDRESS`` target hook,
   except that it includes explicit named address space support.
 
+.. hook-end
+
 .. function:: bool TARGET_ADDR_SPACE_SUBSET_P (addr_space_t subset, addr_space_t superset)
 
+  .. hook-start:TARGET_ADDR_SPACE_SUBSET_P
+
   Define this to return whether the :samp:`{subset}` named address space is
   contained within the :samp:`{superset}` named address space.  Pointers to
   a named address space that is a subset of another named address space
@@ -92,13 +114,21 @@ named address space #1:
   arithmetic operations.  Pointers to a superset address space can be
   converted to pointers to a subset address space via explicit casts.
 
+.. hook-end
+
 .. function:: bool TARGET_ADDR_SPACE_ZERO_ADDRESS_VALID (addr_space_t as)
 
+  .. hook-start:TARGET_ADDR_SPACE_ZERO_ADDRESS_VALID
+
   Define this to modify the default handling of address 0 for the
   address space.  Return true if 0 should be considered a valid address.
 
+.. hook-end
+
 .. function:: rtx TARGET_ADDR_SPACE_CONVERT (rtx op, tree from_type, tree to_type)
 
+  .. hook-start:TARGET_ADDR_SPACE_CONVERT
+
   Define this to convert the pointer expression represented by the RTL
   :samp:`{op}` with type :samp:`{from_type}` that points to a named address
   space to a new pointer expression with type :samp:`{to_type}` that points
@@ -106,13 +136,21 @@ named address space #1:
   guaranteed that one of the two address spaces is a subset of the other,
   as determined by the ``TARGET_ADDR_SPACE_SUBSET_P`` target hook.
 
+.. hook-end
+
 .. function:: int TARGET_ADDR_SPACE_DEBUG (addr_space_t as)
 
+  .. hook-start:TARGET_ADDR_SPACE_DEBUG
+
   Define this to define how the address space is encoded in dwarf.
   The result is the value to be used with ``DW_AT_address_class``.
 
+.. hook-end
+
 .. function:: void TARGET_ADDR_SPACE_DIAGNOSE_USAGE (addr_space_t as, location_t loc)
 
+  .. hook-start:TARGET_ADDR_SPACE_DIAGNOSE_USAGE
+
   Define this hook if the availability of an address space depends on
   command line options and some diagnostics should be printed when the
   address space is used.  This hook is called during parsing and allows
@@ -120,4 +158,6 @@ named address space #1:
   was not registered with ``c_register_addr_space``.  :samp:`{as}` is
   the address space as registered with ``c_register_addr_space``.
   :samp:`{loc}` is the location of the address space qualifier token.
-  The default implementation does nothing.
\ No newline at end of file
+  The default implementation does nothing.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/addressing-modes.rst b/gcc/doc/gccint/target-description-macros-and-functions/addressing-modes.rst
index dfe7519fad8..ab0a582b8a7 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/addressing-modes.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/addressing-modes.rst
@@ -65,6 +65,8 @@ This is about addressing modes.
 
 .. function:: bool TARGET_LEGITIMATE_ADDRESS_P (machine_mode mode, rtx x, bool strict)
 
+  .. hook-start:TARGET_LEGITIMATE_ADDRESS_P
+
   A function that returns whether :samp:`{x}` (an RTX) is a legitimate memory
   address on the target machine for a memory operand of mode :samp:`{mode}`.
 
@@ -129,6 +131,8 @@ This is about addressing modes.
   Using the hook is usually simpler because it limits the number of
   files that are recompiled when changes are made.
 
+.. hook-end
+
 .. c:macro:: TARGET_MEM_CONSTRAINT
 
   A single character to be used instead of the default ``'m'``
@@ -155,6 +159,8 @@ This is about addressing modes.
 
 .. function:: rtx TARGET_LEGITIMIZE_ADDRESS (rtx x, rtx oldx, machine_mode mode)
 
+  .. hook-start:TARGET_LEGITIMIZE_ADDRESS
+
   This hook is given an invalid memory address :samp:`{x}` for an
   operand of mode :samp:`{mode}` and should try to return a valid memory
   address.
@@ -177,6 +183,8 @@ This is about addressing modes.
   a valid way to legitimize the address.  But often a machine-dependent
   strategy can generate better code.
 
+.. hook-end
+
 .. c:macro:: LEGITIMIZE_RELOAD_ADDRESS (x, mode, opnum, type, ind_levels, win)
 
   A C compound statement that attempts to replace :samp:`{x}`, which is an address
@@ -231,6 +239,8 @@ This is about addressing modes.
 
 .. function:: bool TARGET_MODE_DEPENDENT_ADDRESS_P (const_rtx addr, addr_space_t addrspace)
 
+  .. hook-start:TARGET_MODE_DEPENDENT_ADDRESS_P
+
   This hook returns ``true`` if memory address :samp:`{addr}` in address
   space :samp:`{addrspace}` can have
   different meanings depending on the machine mode of the memory
@@ -246,16 +256,24 @@ This is about addressing modes.
 
   The default version of this hook returns ``false``.
 
+.. hook-end
+
 .. function:: bool TARGET_LEGITIMATE_CONSTANT_P (machine_mode mode, rtx x)
 
+  .. hook-start:TARGET_LEGITIMATE_CONSTANT_P
+
   This hook returns true if :samp:`{x}` is a legitimate constant for a
   :samp:`{mode}` -mode immediate operand on the target machine.  You can assume that
   :samp:`{x}` satisfies ``CONSTANT_P``, so you need not check this.
 
   The default definition returns true.
 
+.. hook-end
+
 .. function:: bool TARGET_PRECOMPUTE_TLS_P (machine_mode mode, rtx x)
 
+  .. hook-start:TARGET_PRECOMPUTE_TLS_P
+
   This hook returns true if :samp:`{x}` is a TLS operand on the target
   machine that should be pre-computed when used as the argument in a call.
   You can assume that :samp:`{x}` satisfies ``CONSTANT_P``, so you need not
@@ -263,8 +281,12 @@ This is about addressing modes.
 
   The default definition returns false.
 
+.. hook-end
+
 .. function:: rtx TARGET_DELEGITIMIZE_ADDRESS (rtx x)
 
+  .. hook-start:TARGET_DELEGITIMIZE_ADDRESS
+
   This hook is used to undo the possibly obfuscating effects of the
   ``LEGITIMIZE_ADDRESS`` and ``LEGITIMIZE_RELOAD_ADDRESS`` target
   macros.  Some backend implementations of these macros wrap symbol
@@ -273,13 +295,21 @@ This is about addressing modes.
   the semantics of these opaque ``UNSPEC`` s by converting them back
   into their original form.
 
+.. hook-end
+
 .. function:: bool TARGET_CONST_NOT_OK_FOR_DEBUG_P (rtx x)
 
+  .. hook-start:TARGET_CONST_NOT_OK_FOR_DEBUG_P
+
   This hook should return true if :samp:`{x}` should not be emitted into
   debug sections.
 
+.. hook-end
+
 .. function:: bool TARGET_CANNOT_FORCE_CONST_MEM (machine_mode mode, rtx x)
 
+  .. hook-start:TARGET_CANNOT_FORCE_CONST_MEM
+
   This hook should return true if :samp:`{x}` is of a form that cannot (or
   should not) be spilled to the constant pool.  :samp:`{mode}` is the mode
   of :samp:`{x}`.
@@ -292,29 +322,45 @@ This is about addressing modes.
   holding the constant.  This restriction is often true of addresses
   of TLS symbols for various targets.
 
+.. hook-end
+
 .. function:: bool TARGET_USE_BLOCKS_FOR_CONSTANT_P (machine_mode mode, const_rtx x)
 
+  .. hook-start:TARGET_USE_BLOCKS_FOR_CONSTANT_P
+
   This hook should return true if pool entries for constant :samp:`{x}` can
   be placed in an ``object_block`` structure.  :samp:`{mode}` is the mode
   of :samp:`{x}`.
 
   The default version returns false for all constants.
 
+.. hook-end
+
 .. function:: bool TARGET_USE_BLOCKS_FOR_DECL_P (const_tree decl)
 
+  .. hook-start:TARGET_USE_BLOCKS_FOR_DECL_P
+
   This hook should return true if pool entries for :samp:`{decl}` should
   be placed in an ``object_block`` structure.
 
   The default version returns true for all decls.
 
+.. hook-end
+
 .. function:: tree TARGET_BUILTIN_RECIPROCAL (tree fndecl)
 
+  .. hook-start:TARGET_BUILTIN_RECIPROCAL
+
   This hook should return the DECL of a function that implements the
   reciprocal of the machine-specific builtin function :samp:`{fndecl}`, or
   ``NULL_TREE`` if such a function is not available.
 
+.. hook-end
+
 .. function:: tree TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD (void)
 
+  .. hook-start:TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD
+
   This hook should return the DECL of a function :samp:`{f}` that given an
   address :samp:`{addr}` as an argument returns a mask :samp:`{m}` that can be
   used to extract from two vectors the relevant data that resides in
@@ -342,14 +388,22 @@ This is about addressing modes.
   the argument :samp:`{OFF}` to ``REALIGN_LOAD``, in which case the low
   log2( :samp:`{VS}` ) - 1 bits of :samp:`{addr}` will be considered.
 
+.. hook-end
+
 .. function:: int TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST (enum vect_cost_for_stmt type_of_cost, tree vectype, int misalign)
 
+  .. hook-start:TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST
+
   Returns cost of different scalar or vector statements for vectorization cost model.
   For vector memory operations the cost may depend on type ( :samp:`{vectype}` ) and
   misalignment value ( :samp:`{misalign}` ).
 
+.. hook-end
+
 .. function:: poly_uint64 TARGET_VECTORIZE_PREFERRED_VECTOR_ALIGNMENT (const_tree type)
 
+  .. hook-start:TARGET_VECTORIZE_PREFERRED_VECTOR_ALIGNMENT
+
   This hook returns the preferred alignment in bits for accesses to
   vectors of type :samp:`{type}` in vectorized code.  This might be less than
   or greater than the ABI-defined value returned by
@@ -360,14 +414,22 @@ This is about addressing modes.
   The default hook returns ``TYPE_ALIGN (type)``, which is
   correct for most targets.
 
+.. hook-end
+
 .. function:: bool TARGET_VECTORIZE_VECTOR_ALIGNMENT_REACHABLE (const_tree type, bool is_packed)
 
+  .. hook-start:TARGET_VECTORIZE_VECTOR_ALIGNMENT_REACHABLE
+
   Return true if vector alignment is reachable (by peeling N iterations)
   for the given scalar type :samp:`{type}`.  :samp:`{is_packed}` is false if the scalar
   access using :samp:`{type}` is known to be naturally aligned.
 
+.. hook-end
+
 .. function:: bool TARGET_VECTORIZE_VEC_PERM_CONST (machine_mode mode, rtx output, rtx in0, rtx in1, const vec_perm_indices &sel)
 
+  .. hook-start:TARGET_VECTORIZE_VEC_PERM_CONST
+
   This hook is used to test whether the target can permute up to two
   vectors of mode :samp:`{mode}` using the permutation vector ``sel``, and
   also to emit such a permutation.  In the former case :samp:`{in0}`, :samp:`{in1}`
@@ -387,45 +449,69 @@ This is about addressing modes.
   instruction pattern.  There is no need for the hook to handle these two
   implementation approaches itself.
 
+.. hook-end
+
 .. function:: tree TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION (unsigned code, tree vec_type_out, tree vec_type_in)
 
+  .. hook-start:TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION
+
   This hook should return the decl of a function that implements the
   vectorized variant of the function with the ``combined_fn`` code
   :samp:`{code}` or ``NULL_TREE`` if such a function is not available.
   The return type of the vectorized function shall be of vector type
   :samp:`{vec_type_out}` and the argument types should be :samp:`{vec_type_in}`.
 
+.. hook-end
+
 .. function:: tree TARGET_VECTORIZE_BUILTIN_MD_VECTORIZED_FUNCTION (tree fndecl, tree vec_type_out, tree vec_type_in)
 
+  .. hook-start:TARGET_VECTORIZE_BUILTIN_MD_VECTORIZED_FUNCTION
+
   This hook should return the decl of a function that implements the
   vectorized variant of target built-in function ``fndecl``.  The
   return type of the vectorized function shall be of vector type
   :samp:`{vec_type_out}` and the argument types should be :samp:`{vec_type_in}`.
 
+.. hook-end
+
 .. function:: bool TARGET_VECTORIZE_SUPPORT_VECTOR_MISALIGNMENT (machine_mode mode, const_tree type, int misalignment, bool is_packed)
 
+  .. hook-start:TARGET_VECTORIZE_SUPPORT_VECTOR_MISALIGNMENT
+
   This hook should return true if the target supports misaligned vector
   store/load of a specific factor denoted in the :samp:`{misalignment}`
   parameter.  The vector store/load should be of machine mode :samp:`{mode}` and
   the elements in the vectors should be of type :samp:`{type}`.  :samp:`{is_packed}`
   parameter is true if the memory access is defined in a packed struct.
 
+.. hook-end
+
 .. function:: machine_mode TARGET_VECTORIZE_PREFERRED_SIMD_MODE (scalar_mode mode)
 
+  .. hook-start:TARGET_VECTORIZE_PREFERRED_SIMD_MODE
+
   This hook should return the preferred mode for vectorizing scalar
   mode :samp:`{mode}`.  The default is
   equal to ``word_mode``, because the vectorizer can do some
   transformations even in absence of specialized SIMD hardware.
 
+.. hook-end
+
 .. function:: machine_mode TARGET_VECTORIZE_SPLIT_REDUCTION (machine_mode)
 
+  .. hook-start:TARGET_VECTORIZE_SPLIT_REDUCTION
+
   This hook should return the preferred mode to split the final reduction
   step on :samp:`{mode}` to.  The reduction is then carried out reducing upper
   against lower halves of vectors recursively until the specified mode is
   reached.  The default is :samp:`{mode}` which means no splitting.
 
+.. hook-end
+
 .. function:: unsigned int TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES (vector_modes *modes, bool all)
 
+  .. hook-start:TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_MODES
+
   If using the mode returned by ``TARGET_VECTORIZE_PREFERRED_SIMD_MODE``
   is not the only approach worth considering, this hook should add one mode to
   :samp:`{modes}` for each useful alternative approach.  These modes are then
@@ -455,8 +541,12 @@ This is about addressing modes.
   for autovectorization.  The default implementation adds no modes and
   returns 0.
 
+.. hook-end
+
 .. function:: opt_machine_mode TARGET_VECTORIZE_RELATED_MODE (machine_mode vector_mode, scalar_mode element_mode, poly_uint64 nunits)
 
+  .. hook-start:TARGET_VECTORIZE_RELATED_MODE
+
   If a piece of code is using vector mode :samp:`{vector_mode}` and also wants
   to operate on elements of mode :samp:`{element_mode}`, return the vector mode
   it should use for those elements.  If :samp:`{nunits}` is nonzero, ensure that
@@ -479,8 +569,12 @@ This is about addressing modes.
   requested mode, returning a mode with the same size as :samp:`{vector_mode}`
   when :samp:`{nunits}` is zero.  This is the correct behavior for most targets.
 
+.. hook-end
+
 .. function:: opt_machine_mode TARGET_VECTORIZE_GET_MASK_MODE (machine_mode mode)
 
+  .. hook-start:TARGET_VECTORIZE_GET_MASK_MODE
+
   Return the mode to use for a vector mask that holds one boolean
   result for each element of vector mode :samp:`{mode}`.  The returned mask mode
   can be a vector of integers (class ``MODE_VECTOR_INT`` ), a vector of
@@ -491,14 +585,22 @@ This is about addressing modes.
   The default implementation returns a ``MODE_VECTOR_INT`` with the
   same size and number of elements as :samp:`{mode}`, if such a mode exists.
 
+.. hook-end
+
 .. function:: bool TARGET_VECTORIZE_EMPTY_MASK_IS_EXPENSIVE (unsigned ifn)
 
+  .. hook-start:TARGET_VECTORIZE_EMPTY_MASK_IS_EXPENSIVE
+
   This hook returns true if masked internal function :samp:`{ifn}` (really of
   type ``internal_fn`` ) should be considered expensive when the mask is
   all zeros.  GCC can then try to branch around the instruction instead.
 
+.. hook-end
+
 .. function:: void * TARGET_VECTORIZE_INIT_COST (class loop *loop_info, bool costing_for_scalar)
 
+  .. hook-start:TARGET_VECTORIZE_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,
@@ -508,8 +610,12 @@ This is about addressing modes.
   current cost model is for the scalar version of a loop or block; otherwise
   it is for the vector version.
 
+.. hook-end
+
 .. function:: unsigned TARGET_VECTORIZE_ADD_STMT_COST (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)
 
+  .. hook-start:TARGET_VECTORIZE_ADD_STMT_COST
+
   This hook should update the target-specific :samp:`{data}` in response to
   adding :samp:`{count}` copies of the given :samp:`{kind}` of statement to a
   loop or basic block.  The default adds the builtin vectorizer cost for
@@ -518,68 +624,108 @@ This is about addressing modes.
   return value should be viewed as a tentative cost that may later be
   revised.
 
+.. hook-end
+
 .. function:: void TARGET_VECTORIZE_FINISH_COST (void *data, unsigned *prologue_cost, unsigned *body_cost, unsigned *epilogue_cost)
 
+  .. hook-start:TARGET_VECTORIZE_FINISH_COST
+
   This hook should complete calculations of the cost of vectorizing a loop
   or basic block based on :samp:`{data}`, and return the prologue, body, and
   epilogue costs as unsigned integers.  The default returns the value of
   the three accumulators.
 
+.. hook-end
+
 .. function:: void TARGET_VECTORIZE_DESTROY_COST_DATA (void *data)
 
+  .. hook-start:TARGET_VECTORIZE_DESTROY_COST_DATA
+
   This hook should release :samp:`{data}` and any related data structures
   allocated by TARGET_VECTORIZE_INIT_COST.  The default releases the
   accumulator.
 
+.. hook-end
+
 .. function:: tree TARGET_VECTORIZE_BUILTIN_GATHER (const_tree mem_vectype, const_tree index_type, int scale)
 
+  .. hook-start:TARGET_VECTORIZE_BUILTIN_GATHER
+
   Target builtin that implements vector gather operation.  :samp:`{mem_vectype}`
   is the vector type of the load and :samp:`{index_type}` is scalar type of
   the index, scaled by :samp:`{scale}`.
   The default is ``NULL_TREE`` which means to not vectorize gather
   loads.
 
+.. hook-end
+
 .. function:: tree TARGET_VECTORIZE_BUILTIN_SCATTER (const_tree vectype, const_tree index_type, int scale)
 
+  .. hook-start:TARGET_VECTORIZE_BUILTIN_SCATTER
+
   Target builtin that implements vector scatter operation.  :samp:`{vectype}`
   is the vector type of the store and :samp:`{index_type}` is scalar type of
   the index, scaled by :samp:`{scale}`.
   The default is ``NULL_TREE`` which means to not vectorize scatter
   stores.
 
+.. hook-end
+
 .. function:: int TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN (struct cgraph_node *, struct cgraph_simd_clone *, tree, int)
 
+  .. hook-start:TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN
+
   This hook should set :samp:`{vecsize_mangle}`, :samp:`{vecsize_int}`, :samp:`{vecsize_float}`
   fields in :samp:`{simd_clone}` structure pointed by :samp:`{clone_info}` argument and also
   :samp:`{simdlen}` field if it was previously 0.
   The hook should return 0 if SIMD clones shouldn't be emitted,
   or number of :samp:`{vecsize_mangle}` variants that should be emitted.
 
+.. hook-end
+
 .. function:: void TARGET_SIMD_CLONE_ADJUST (struct cgraph_node *)
 
+  .. hook-start:TARGET_SIMD_CLONE_ADJUST
+
   This hook should add implicit ``attribute(target("..."))`` attribute
   to SIMD clone :samp:`{node}` if needed.
 
+.. hook-end
+
 .. function:: int TARGET_SIMD_CLONE_USABLE (struct cgraph_node *)
 
+  .. hook-start:TARGET_SIMD_CLONE_USABLE
+
   This hook should return -1 if SIMD clone :samp:`{node}` shouldn't be used
   in vectorized loops in current function, or non-negative number if it is
   usable.  In that case, the smaller the number is, the more desirable it is
   to use it.
 
+.. hook-end
+
 .. function:: int TARGET_SIMT_VF (void)
 
+  .. hook-start:TARGET_SIMT_VF
+
   Return number of threads in SIMT thread group on the target.
 
+.. hook-end
+
 .. function:: int TARGET_OMP_DEVICE_KIND_ARCH_ISA (enum omp_device_kind_arch_isa trait, const char *name)
 
+  .. hook-start:TARGET_OMP_DEVICE_KIND_ARCH_ISA
+
   Return 1 if :samp:`{trait}` :samp:`{name}` is present in the OpenMP context's
   device trait set, return 0 if not present in any OpenMP context in the
   whole translation unit, or -1 if not present in the current OpenMP context
   but might be present in another OpenMP context in the same TU.
 
+.. hook-end
+
 .. function:: bool TARGET_GOACC_VALIDATE_DIMS (tree decl, int *dims, int fn_level, unsigned used)
 
+  .. hook-start:TARGET_GOACC_VALIDATE_DIMS
+
   This hook should check the launch dimensions provided for an OpenACC
   compute region, or routine.  Defaulted values are represented as -1
   and non-constant values as 0.  The :samp:`{fn_level}` is negative for the
@@ -591,13 +737,21 @@ This is about addressing modes.
   true, if changes have been made.  You must override this hook to
   provide dimensions larger than 1.
 
+.. hook-end
+
 .. function:: int TARGET_GOACC_DIM_LIMIT (int axis)
 
+  .. hook-start:TARGET_GOACC_DIM_LIMIT
+
   This hook should return the maximum size of a particular dimension,
   or zero if unbounded.
 
+.. hook-end
+
 .. function:: bool TARGET_GOACC_FORK_JOIN (gcall *call, const int *dims, bool is_fork)
 
+  .. hook-start:TARGET_GOACC_FORK_JOIN
+
   This hook can be used to convert IFN_GOACC_FORK and IFN_GOACC_JOIN
   function calls to target-specific gimple, or indicate whether they
   should be retained.  It is executed during the oacc_device_lower pass.
@@ -606,8 +760,12 @@ This is about addressing modes.
   gimple has been inserted before it, or there is no need for it).
   The default hook returns false, if there are no RTL expanders for them.
 
+.. hook-end
+
 .. function:: void TARGET_GOACC_REDUCTION (gcall *call)
 
+  .. hook-start:TARGET_GOACC_REDUCTION
+
   This hook is used by the oacc_transform pass to expand calls to the
   :samp:`{GOACC_REDUCTION}` internal function, into a sequence of gimple
   instructions.  :samp:`{call}` is gimple statement containing the call to
@@ -615,8 +773,12 @@ This is about addressing modes.
   expanded sequence has been inserted.  This hook is also responsible
   for allocating any storage for reductions when necessary.
 
+.. hook-end
+
 .. function:: tree TARGET_PREFERRED_ELSE_VALUE (unsigned ifn, tree type, unsigned nops, tree *ops)
 
+  .. hook-start:TARGET_PREFERRED_ELSE_VALUE
+
   This hook returns the target's preferred final argument for a call
   to conditional internal function :samp:`{ifn}` (really of type
   ``internal_fn`` ).  :samp:`{type}` specifies the return type of the
@@ -631,8 +793,12 @@ This is about addressing modes.
   like ``cond_addm``.  The default implementation returns a zero
   constant of type :samp:`{type}`.
 
+.. hook-end
+
 .. function:: tree TARGET_GOACC_ADJUST_PRIVATE_DECL (location_t loc, tree var, int level)
 
+  .. hook-start:TARGET_GOACC_ADJUST_PRIVATE_DECL
+
   This hook, if defined, is used by accelerator target back-ends to adjust
   OpenACC variable declarations that should be made private to the given
   parallelism level (i.e. ``GOMP_DIM_GANG``, ``GOMP_DIM_WORKER`` or
@@ -644,8 +810,12 @@ This is about addressing modes.
   adjusted variable declaration needs to be expanded to RTL in a non-standard
   way.
 
+.. hook-end
+
 .. function:: rtx TARGET_GOACC_EXPAND_VAR_DECL (tree var)
 
+  .. hook-start:TARGET_GOACC_EXPAND_VAR_DECL
+
   This hook, if defined, is used by accelerator target back-ends to expand
   specially handled kinds of ``VAR_DECL`` expressions.  A particular use is
   to place variables with specific attributes inside special accelarator
@@ -655,4 +825,6 @@ This is about addressing modes.
   Only define this hook if your accelerator target needs to expand certain
   ``VAR_DECL`` nodes in a way that differs from the default.  You can also adjust
   private variables at OpenACC device-lowering time using the
-  ``TARGET_GOACC_ADJUST_PRIVATE_DECL`` target hook.
\ No newline at end of file
+  ``TARGET_GOACC_ADJUST_PRIVATE_DECL`` target hook.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/adjusting-the-instruction-scheduler.rst b/gcc/doc/gccint/target-description-macros-and-functions/adjusting-the-instruction-scheduler.rst
index 70bfabfacc3..023e77bb3ef 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/adjusting-the-instruction-scheduler.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/adjusting-the-instruction-scheduler.rst
@@ -15,6 +15,8 @@ them: try the first ones in this list first.
 
 .. function:: int TARGET_SCHED_ISSUE_RATE (void)
 
+  .. hook-start:TARGET_SCHED_ISSUE_RATE
+
   This hook returns the maximum number of instructions that can ever
   issue at the same time on the target machine.  The default is one.
   Although the insn scheduler can define itself the possibility of issue
@@ -25,8 +27,12 @@ them: try the first ones in this list first.
   it to vary depending on what the instructions are, you must use
   :samp:`TARGET_SCHED_VARIABLE_ISSUE`.
 
+.. hook-end
+
 .. function:: int TARGET_SCHED_VARIABLE_ISSUE (FILE *file, int verbose, rtx_insn *insn, int more)
 
+  .. hook-start:TARGET_SCHED_VARIABLE_ISSUE
+
   This hook is executed by the scheduler after it has scheduled an insn
   from the ready list.  It should return the number of insns which can
   still be issued in the current cycle.  The default is
@@ -39,8 +45,12 @@ them: try the first ones in this list first.
   :option:`-fsched-verbose-`:samp:`{n}`.  :samp:`{insn}` is the instruction that
   was scheduled.
 
+.. hook-end
+
 .. function:: int TARGET_SCHED_ADJUST_COST (rtx_insn *insn, int dep_type1, rtx_insn *dep_insn, int cost, unsigned int dw)
 
+  .. hook-start:TARGET_SCHED_ADJUST_COST
+
   This function corrects the value of :samp:`{cost}` based on the
   relationship between :samp:`{insn}` and :samp:`{dep_insn}` through a
   dependence of type dep_type, and strength :samp:`{dw}`.  It should return the new
@@ -54,16 +64,24 @@ them: try the first ones in this list first.
   acceptable, you could use the hook to modify them too.  See also
   see :ref:`processor-pipeline-description`.
 
+.. hook-end
+
 .. function:: int TARGET_SCHED_ADJUST_PRIORITY (rtx_insn *insn, int priority)
 
+  .. hook-start:TARGET_SCHED_ADJUST_PRIORITY
+
   This hook adjusts the integer scheduling priority :samp:`{priority}` of
   :samp:`{insn}`.  It should return the new priority.  Increase the priority to
   execute :samp:`{insn}` earlier, reduce the priority to execute :samp:`{insn}`
   later.  Do not define this hook if you do not need to adjust the
   scheduling priorities of insns.
 
+.. hook-end
+
 .. function:: int TARGET_SCHED_REORDER (FILE *file, int verbose, rtx_insn **ready, int *n_readyp, int clock)
 
+  .. hook-start:TARGET_SCHED_REORDER
+
   This hook is executed by the scheduler after it has scheduled the ready
   list, to allow the machine description to reorder it (for example to
   combine two small instructions together on :samp:`VLIW` machines).
@@ -79,8 +97,12 @@ them: try the first ones in this list first.
   can issue this cycle; normally this is just ``issue_rate``.  See also
   :samp:`TARGET_SCHED_REORDER2`.
 
+.. hook-end
+
 .. function:: int TARGET_SCHED_REORDER2 (FILE *file, int verbose, rtx_insn **ready, int *n_readyp, int clock)
 
+  .. hook-start:TARGET_SCHED_REORDER2
+
   Like :samp:`TARGET_SCHED_REORDER`, but called at a different time.  That
   function is called whenever the scheduler starts a new cycle.  This one
   is called once per iteration over a cycle, immediately after
@@ -90,12 +112,20 @@ them: try the first ones in this list first.
   scheduling one insn causes other insns to become ready in the same
   cycle.  These other insns can then be taken into account properly.
 
+.. hook-end
+
 .. function:: bool TARGET_SCHED_MACRO_FUSION_P (void)
 
+  .. hook-start:TARGET_SCHED_MACRO_FUSION_P
+
   This hook is used to check whether target platform supports macro fusion.
 
+.. hook-end
+
 .. function:: bool TARGET_SCHED_MACRO_FUSION_PAIR_P (rtx_insn *prev, rtx_insn *curr)
 
+  .. hook-start:TARGET_SCHED_MACRO_FUSION_PAIR_P
+
   This hook is used to check whether two insns should be macro fused for
   a target microarchitecture. If this hook returns true for the given insn pair
   ( :samp:`{prev}` and :samp:`{curr}` ), the scheduler will put them into a sched
@@ -103,8 +133,12 @@ them: try the first ones in this list first.
   two SET insns or a compare and a conditional jump and this hook should
   validate any dependencies needed to fuse the two insns together.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK (rtx_insn *head, rtx_insn *tail)
 
+  .. hook-start:TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK
+
   This hook is called after evaluation forward dependencies of insns in
   chain given by two parameter values ( :samp:`{head}` and :samp:`{tail}`
   correspondingly) but before insns scheduling of the insn chain.  For
@@ -113,8 +147,12 @@ them: try the first ones in this list first.
   dependencies of the insn scheduler because they are already
   calculated.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_INIT (FILE *file, int verbose, int max_ready)
 
+  .. hook-start:TARGET_SCHED_INIT
+
   This hook is executed by the scheduler at the beginning of each block of
   instructions that are to be scheduled.  :samp:`{file}` is either a null
   pointer, or a stdio stream to write any debug output to.  :samp:`{verbose}`
@@ -123,8 +161,12 @@ them: try the first ones in this list first.
   region that can be live at the same time.  This can be used to allocate
   scratch space if it is needed, e.g. by :samp:`TARGET_SCHED_REORDER`.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_FINISH (FILE *file, int verbose)
 
+  .. hook-start:TARGET_SCHED_FINISH
+
   This hook is executed by the scheduler at the end of each block of
   instructions that are to be scheduled.  It can be used to perform
   cleanup of any actions done by the other scheduling hooks.  :samp:`{file}`
@@ -132,21 +174,33 @@ them: try the first ones in this list first.
   to.  :samp:`{verbose}` is the verbose level provided by
   :option:`-fsched-verbose-`:samp:`{n}`.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_INIT_GLOBAL (FILE *file, int verbose, int old_max_uid)
 
+  .. hook-start:TARGET_SCHED_INIT_GLOBAL
+
   This hook is executed by the scheduler after function level initializations.
   :samp:`{file}` is either a null pointer, or a stdio stream to write any debug output to.
   :samp:`{verbose}` is the verbose level provided by :option:`-fsched-verbose-`:samp:`{n}`.
   :samp:`{old_max_uid}` is the maximum insn uid when scheduling begins.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_FINISH_GLOBAL (FILE *file, int verbose)
 
+  .. hook-start:TARGET_SCHED_FINISH_GLOBAL
+
   This is the cleanup hook corresponding to ``TARGET_SCHED_INIT_GLOBAL``.
   :samp:`{file}` is either a null pointer, or a stdio stream to write any debug output to.
   :samp:`{verbose}` is the verbose level provided by :option:`-fsched-verbose-`:samp:`{n}`.
 
+.. hook-end
+
 .. function:: rtx TARGET_SCHED_DFA_PRE_CYCLE_INSN (void)
 
+  .. hook-start:TARGET_SCHED_DFA_PRE_CYCLE_INSN
+
   The hook returns an RTL insn.  The automaton state used in the
   pipeline hazard recognizer is changed as if the insn were scheduled
   when the new simulated processor cycle starts.  Usage of the hook may
@@ -155,37 +209,61 @@ them: try the first ones in this list first.
   based pipeline description.  The default is not to change the state
   when the new simulated processor cycle starts.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN (void)
 
+  .. hook-start:TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN
+
   The hook can be used to initialize data used by the previous hook.
 
+.. hook-end
+
 .. function:: rtx_insn * TARGET_SCHED_DFA_POST_CYCLE_INSN (void)
 
+  .. hook-start:TARGET_SCHED_DFA_POST_CYCLE_INSN
+
   The hook is analogous to :samp:`TARGET_SCHED_DFA_PRE_CYCLE_INSN` but used
   to changed the state as if the insn were scheduled when the new
   simulated processor cycle finishes.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN (void)
 
+  .. hook-start:TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN
+
   The hook is analogous to :samp:`TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN` but
   used to initialize data used by the previous hook.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE (void)
 
+  .. hook-start:TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE
+
   The hook to notify target that the current simulated cycle is about to finish.
   The hook is analogous to :samp:`TARGET_SCHED_DFA_PRE_CYCLE_INSN` but used
   to change the state in more complicated situations - e.g., when advancing
   state on a single insn is not enough.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_DFA_POST_ADVANCE_CYCLE (void)
 
+  .. hook-start:TARGET_SCHED_DFA_POST_ADVANCE_CYCLE
+
   The hook to notify target that new simulated cycle has just started.
   The hook is analogous to :samp:`TARGET_SCHED_DFA_POST_CYCLE_INSN` but used
   to change the state in more complicated situations - e.g., when advancing
   state on a single insn is not enough.
 
+.. hook-end
+
 .. function:: int TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD (void)
 
+  .. hook-start:TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD
+
   This hook controls better choosing an insn from the ready insn queue
   for the DFA-based insn scheduler.  Usually the scheduler
   chooses the first insn from the queue.  If the hook returns a positive
@@ -213,8 +291,12 @@ them: try the first ones in this list first.
 
   The default is no multipass scheduling.
 
+.. hook-end
+
 .. function:: int TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD (rtx_insn *insn, int ready_index)
 
+  .. hook-start:TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD
+
   This hook controls what insns from the ready insn queue will be
   considered for the multipass insn scheduling.  If the hook returns
   zero for :samp:`{insn}`, the insn will be considered in multipass scheduling.
@@ -228,35 +310,63 @@ them: try the first ones in this list first.
 
   The default is that any ready insns can be chosen to be issued.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_FIRST_CYCLE_MULTIPASS_BEGIN (void *data, signed char *ready_try, int n_ready, bool first_cycle_insn_p)
 
+  .. hook-start:TARGET_SCHED_FIRST_CYCLE_MULTIPASS_BEGIN
+
   This hook prepares the target backend for a new round of multipass
   scheduling.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_FIRST_CYCLE_MULTIPASS_ISSUE (void *data, signed char *ready_try, int n_ready, rtx_insn *insn, const void *prev_data)
 
+  .. hook-start:TARGET_SCHED_FIRST_CYCLE_MULTIPASS_ISSUE
+
   This hook is called when multipass scheduling evaluates instruction INSN.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_FIRST_CYCLE_MULTIPASS_BACKTRACK (const void *data, signed char *ready_try, int n_ready)
 
+  .. hook-start:TARGET_SCHED_FIRST_CYCLE_MULTIPASS_BACKTRACK
+
   This is called when multipass scheduling backtracks from evaluation of
   an instruction.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_FIRST_CYCLE_MULTIPASS_END (const void *data)
 
+  .. hook-start:TARGET_SCHED_FIRST_CYCLE_MULTIPASS_END
+
   This hook notifies the target about the result of the concluded current
   round of multipass scheduling.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_FIRST_CYCLE_MULTIPASS_INIT (void *data)
 
+  .. hook-start:TARGET_SCHED_FIRST_CYCLE_MULTIPASS_INIT
+
   This hook initializes target-specific data used in multipass scheduling.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_FIRST_CYCLE_MULTIPASS_FINI (void *data)
 
+  .. hook-start:TARGET_SCHED_FIRST_CYCLE_MULTIPASS_FINI
+
   This hook finalizes target-specific data used in multipass scheduling.
 
+.. hook-end
+
 .. function:: int TARGET_SCHED_DFA_NEW_CYCLE (FILE *dump, int verbose, rtx_insn *insn, int last_clock, int clock, int *sort_p)
 
+  .. hook-start:TARGET_SCHED_DFA_NEW_CYCLE
+
   This hook is called by the insn scheduler before issuing :samp:`{insn}`
   on cycle :samp:`{clock}`.  If the hook returns nonzero,
   :samp:`{insn}` is not issued on this processor cycle.  Instead,
@@ -268,8 +378,12 @@ them: try the first ones in this list first.
   processor cycle on which the previous insn has been issued,
   and the current processor cycle.
 
+.. hook-end
+
 .. function:: bool TARGET_SCHED_IS_COSTLY_DEPENDENCE (struct _dep *_dep, int cost, int distance)
 
+  .. hook-start:TARGET_SCHED_IS_COSTLY_DEPENDENCE
+
   This hook is used to define which dependences are considered costly by
   the target, so costly that it is not advisable to schedule the insns that
   are involved in the dependence too close to one another.  The parameters
@@ -289,36 +403,64 @@ them: try the first ones in this list first.
   closer to one another---i.e., closer than the dependence distance;  however,
   not in cases of 'costly dependences', which this hooks allows to define.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_H_I_D_EXTENDED (void)
 
+  .. hook-start:TARGET_SCHED_H_I_D_EXTENDED
+
   This hook is called by the insn scheduler after emitting a new instruction to
   the instruction stream.  The hook notifies a target backend to extend its
   per instruction data structures.
 
+.. hook-end
+
 .. function:: void * TARGET_SCHED_ALLOC_SCHED_CONTEXT (void)
 
+  .. hook-start:TARGET_SCHED_ALLOC_SCHED_CONTEXT
+
   Return a pointer to a store large enough to hold target scheduling context.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_INIT_SCHED_CONTEXT (void *tc, bool clean_p)
 
+  .. hook-start:TARGET_SCHED_INIT_SCHED_CONTEXT
+
   Initialize store pointed to by :samp:`{tc}` to hold target scheduling context.
   It :samp:`{clean_p}` is true then initialize :samp:`{tc}` as if scheduler is at the
   beginning of the block.  Otherwise, copy the current context into :samp:`{tc}`.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_SET_SCHED_CONTEXT (void *tc)
 
+  .. hook-start:TARGET_SCHED_SET_SCHED_CONTEXT
+
   Copy target scheduling context pointed to by :samp:`{tc}` to the current context.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_CLEAR_SCHED_CONTEXT (void *tc)
 
+  .. hook-start:TARGET_SCHED_CLEAR_SCHED_CONTEXT
+
   Deallocate internal data in target scheduling context pointed to by :samp:`{tc}`.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_FREE_SCHED_CONTEXT (void *tc)
 
+  .. hook-start:TARGET_SCHED_FREE_SCHED_CONTEXT
+
   Deallocate a store for target scheduling context pointed to by :samp:`{tc}`.
 
+.. hook-end
+
 .. function:: int TARGET_SCHED_SPECULATE_INSN (rtx_insn *insn, unsigned int dep_status, rtx *new_pat)
 
+  .. hook-start:TARGET_SCHED_SPECULATE_INSN
+
   This hook is called by the insn scheduler when :samp:`{insn}` has only
   speculative dependencies and therefore can be scheduled speculatively.
   The hook is used to check if the pattern of :samp:`{insn}` has a speculative
@@ -328,14 +470,22 @@ them: try the first ones in this list first.
   speculation.  If the return value equals 1 then :samp:`{new_pat}` is assigned
   the generated speculative pattern.
 
+.. hook-end
+
 .. function:: bool TARGET_SCHED_NEEDS_BLOCK_P (unsigned int dep_status)
 
+  .. hook-start:TARGET_SCHED_NEEDS_BLOCK_P
+
   This hook is called by the insn scheduler during generation of recovery code
   for :samp:`{insn}`.  It should return ``true``, if the corresponding check
   instruction should branch to recovery code, or ``false`` otherwise.
 
+.. hook-end
+
 .. function:: rtx TARGET_SCHED_GEN_SPEC_CHECK (rtx_insn *insn, rtx_insn *label, unsigned int ds)
 
+  .. hook-start:TARGET_SCHED_GEN_SPEC_CHECK
+
   This hook is called by the insn scheduler to generate a pattern for recovery
   check instruction.  If :samp:`{mutate_p}` is zero, then :samp:`{insn}` is a
   speculative instruction for which the check should be generated.
@@ -345,23 +495,35 @@ them: try the first ones in this list first.
   a pattern for a branchy check corresponding to a simple check denoted by
   :samp:`{insn}` should be generated.  In this case :samp:`{label}` can't be null.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_SET_SCHED_FLAGS (struct spec_info_def *spec_info)
 
+  .. hook-start:TARGET_SCHED_SET_SCHED_FLAGS
+
   This hook is used by the insn scheduler to find out what features should be
   enabled/used.
   The structure \* :samp:`{spec_info}` should be filled in by the target.
   The structure describes speculation types that can be used in the scheduler.
 
+.. hook-end
+
 .. function:: bool TARGET_SCHED_CAN_SPECULATE_INSN (rtx_insn *insn)
 
+  .. hook-start:TARGET_SCHED_CAN_SPECULATE_INSN
+
   Some instructions should never be speculated by the schedulers, usually
    because the instruction is too expensive to get this wrong.  Often such
    instructions have long latency, and often they are not fully modeled in the
    pipeline descriptions.  This hook should return ``false`` if :samp:`{insn}`
    should not be speculated.
 
+.. hook-end
+
 .. function:: int TARGET_SCHED_SMS_RES_MII (struct ddg *g)
 
+  .. hook-start:TARGET_SCHED_SMS_RES_MII
+
   This hook is called by the swing modulo scheduler to calculate a
   resource-based lower bound which is based on the resources available in
   the machine and the resources required by each instruction.  The target
@@ -369,29 +531,49 @@ them: try the first ones in this list first.
   bound will be used in case this hook is not implemented: the total number
   of instructions divided by the issue rate.
 
+.. hook-end
+
 .. function:: bool TARGET_SCHED_DISPATCH (rtx_insn *insn, int x)
 
+  .. hook-start:TARGET_SCHED_DISPATCH
+
   This hook is called by Haifa Scheduler.  It returns true if dispatch scheduling
   is supported in hardware and the condition specified in the parameter is true.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_DISPATCH_DO (rtx_insn *insn, int x)
 
+  .. hook-start:TARGET_SCHED_DISPATCH_DO
+
   This hook is called by Haifa Scheduler.  It performs the operation specified
   in its second parameter.
 
+.. hook-end
+
 .. c:var:: bool TARGET_SCHED_EXPOSED_PIPELINE
 
+  .. hook-start:TARGET_SCHED_EXPOSED_PIPELINE
+
   True if the processor has an exposed pipeline, which means that not just
   the order of instructions is important for correctness when scheduling, but
   also the latencies of operations.
 
+.. hook-end
+
 .. function:: int TARGET_SCHED_REASSOCIATION_WIDTH (unsigned int opc, machine_mode mode)
 
+  .. hook-start:TARGET_SCHED_REASSOCIATION_WIDTH
+
   This hook is called by tree reassociator to determine a level of
   parallelism required in output calculations chain.
 
+.. hook-end
+
 .. function:: void TARGET_SCHED_FUSION_PRIORITY (rtx_insn *insn, int max_pri, int *fusion_pri, int *pri)
 
+  .. hook-start:TARGET_SCHED_FUSION_PRIORITY
+
   This hook is called by scheduling fusion pass.  It calculates fusion
   priorities for each instruction passed in by parameter.  The priorities
   are returned via pointer parameters.
@@ -466,7 +648,13 @@ them: try the first ones in this list first.
   This is firstly introduced on ARM/AArch64 targets, please refer to
   the hook implementation for how different fusion types are supported.
 
+.. hook-end
+
 .. function:: void TARGET_EXPAND_DIVMOD_LIBFUNC (rtx libfunc, machine_mode mode, rtx op0, rtx op1, rtx *quot, rtx *rem)
 
+  .. hook-start:TARGET_EXPAND_DIVMOD_LIBFUNC
+
   Define this hook for enabling divmod transform if the port does not have
-  hardware divmod insn but defines target-specific divmod libfuncs.
\ No newline at end of file
+  hardware divmod insn but defines target-specific divmod libfuncs.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/anchored-addresses.rst b/gcc/doc/gccint/target-description-macros-and-functions/anchored-addresses.rst
index 44e12dbd1d1..8ff208b6c2c 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/anchored-addresses.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/anchored-addresses.rst
@@ -44,19 +44,29 @@ or ``TARGET_MAX_ANCHOR_OFFSET`` is set to a nonzero value.
 
 .. c:var:: HOST_WIDE_INT TARGET_MIN_ANCHOR_OFFSET
 
+  .. hook-start:TARGET_MIN_ANCHOR_OFFSET
+
   The minimum offset that should be applied to a section anchor.
   On most targets, it should be the smallest offset that can be
   applied to a base register while still giving a legitimate address
   for every mode.  The default value is 0.
 
+.. hook-end
+
 .. c:var:: HOST_WIDE_INT TARGET_MAX_ANCHOR_OFFSET
 
+  .. hook-start:TARGET_MAX_ANCHOR_OFFSET
+
   Like ``TARGET_MIN_ANCHOR_OFFSET``, but the maximum (inclusive)
   offset that should be applied to section anchors.  The default
   value is 0.
 
+.. hook-end
+
 .. function:: void TARGET_ASM_OUTPUT_ANCHOR (rtx x)
 
+  .. hook-start:TARGET_ASM_OUTPUT_ANCHOR
+
   Write the assembly code to define section anchor :samp:`{x}`, which is a
   ``SYMBOL_REF`` for which :samp:`SYMBOL_REF_ANCHOR_P ({x})` is true.
   The hook is called with the assembly output position set to the beginning
@@ -67,12 +77,18 @@ or ``TARGET_MAX_ANCHOR_OFFSET`` is set to a nonzero value.
   If ``ASM_OUTPUT_DEF`` is not available, the hook's default definition
   is ``NULL``, which disables the use of section anchors altogether.
 
+.. hook-end
+
 .. function:: bool TARGET_USE_ANCHORS_FOR_SYMBOL_P (const_rtx x)
 
+  .. hook-start:TARGET_USE_ANCHORS_FOR_SYMBOL_P
+
   Return true if GCC should attempt to use anchors to access ``SYMBOL_REF``
   :samp:`{x}`.  You can assume :samp:`SYMBOL_REF_HAS_BLOCK_INFO_P ({x})` and
   :samp:`!SYMBOL_REF_ANCHOR_P ({x})`.
 
   The default version is correct for most targets, but you might need to
   intercept this hook to handle things like target-specific attributes
-  or target-specific sections.
\ No newline at end of file
+  or target-specific sections.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/c++-abi-parameters.rst b/gcc/doc/gccint/target-description-macros-and-functions/c++-abi-parameters.rst
index ce24a678a29..f1495e6917d 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/c++-abi-parameters.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/c++-abi-parameters.rst
@@ -12,31 +12,49 @@ C++ ABI parameters
 
 .. function:: tree TARGET_CXX_GUARD_TYPE (void)
 
+  .. hook-start:TARGET_CXX_GUARD_TYPE
+
   Define this hook to override the integer type used for guard variables.
   These are used to implement one-time construction of static objects.  The
   default is long_long_integer_type_node.
 
+.. hook-end
+
 .. function:: bool TARGET_CXX_GUARD_MASK_BIT (void)
 
+  .. hook-start:TARGET_CXX_GUARD_MASK_BIT
+
   This hook determines how guard variables are used.  It should return
   ``false`` (the default) if the first byte should be used.  A return value of
   ``true`` indicates that only the least significant bit should be used.
 
+.. hook-end
+
 .. function:: tree TARGET_CXX_GET_COOKIE_SIZE (tree type)
 
+  .. hook-start:TARGET_CXX_GET_COOKIE_SIZE
+
   This hook returns the size of the cookie to use when allocating an array
   whose elements have the indicated :samp:`{type}`.  Assumes that it is already
   known that a cookie is needed.  The default is
   ``max(sizeof (size_t), alignof(type))``, as defined in section 2.7 of the
   IA64/Generic C++ ABI.
 
+.. hook-end
+
 .. function:: bool TARGET_CXX_COOKIE_HAS_SIZE (void)
 
+  .. hook-start:TARGET_CXX_COOKIE_HAS_SIZE
+
   This hook should return ``true`` if the element size should be stored in
   array cookies.  The default is to return ``false``.
 
+.. hook-end
+
 .. function:: int TARGET_CXX_IMPORT_EXPORT_CLASS (tree type, int import_export)
 
+  .. hook-start:TARGET_CXX_IMPORT_EXPORT_CLASS
+
   If defined by a backend this hook allows the decision made to export
   class :samp:`{type}` to be overruled.  Upon entry :samp:`{import_export}`
   will contain 1 if the class is going to be exported, -1 if it is going
@@ -44,14 +62,22 @@ C++ ABI parameters
   modified value and perform any other actions necessary to support the
   backend's targeted operating system.
 
+.. hook-end
+
 .. function:: bool TARGET_CXX_CDTOR_RETURNS_THIS (void)
 
+  .. hook-start:TARGET_CXX_CDTOR_RETURNS_THIS
+
   This hook should return ``true`` if constructors and destructors return
   the address of the object created/destroyed.  The default is to return
   ``false``.
 
+.. hook-end
+
 .. function:: bool TARGET_CXX_KEY_METHOD_MAY_BE_INLINE (void)
 
+  .. hook-start:TARGET_CXX_KEY_METHOD_MAY_BE_INLINE
+
   This hook returns true if the key method for a class (i.e., the method
   which, if defined in the current translation unit, causes the virtual
   table to be emitted) may be an inline function.  Under the standard
@@ -60,8 +86,12 @@ C++ ABI parameters
   some variants of the ABI, an inline function can never be the key
   method.  The default is to return ``true``.
 
+.. hook-end
+
 .. function:: void TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY (tree decl)
 
+  .. hook-start:TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY
+
   :samp:`{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
@@ -69,40 +99,66 @@ C++ ABI parameters
   other than that of the containing class, use this hook to set
   ``DECL_VISIBILITY`` and ``DECL_VISIBILITY_SPECIFIED``.
 
+.. hook-end
+
 .. function:: bool TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT (void)
 
+  .. hook-start:TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT
+
   This hook returns true (the default) if virtual tables and other
   similar implicit class data objects are always COMDAT if they have
   external linkage.  If this hook returns false, then class data for
   classes whose virtual table will be emitted in only one translation
   unit will not be COMDAT.
 
+.. hook-end
+
 .. function:: bool TARGET_CXX_LIBRARY_RTTI_COMDAT (void)
 
+  .. hook-start:TARGET_CXX_LIBRARY_RTTI_COMDAT
+
   This hook returns true (the default) if the RTTI information for
   the basic types which is defined in the C++ runtime should always
   be COMDAT, false if it should not be COMDAT.
 
+.. hook-end
+
 .. function:: bool TARGET_CXX_USE_AEABI_ATEXIT (void)
 
+  .. hook-start:TARGET_CXX_USE_AEABI_ATEXIT
+
   This hook returns true if ``__aeabi_atexit`` (as defined by the ARM EABI)
   should be used to register static destructors when :option:`-fuse-cxa-atexit`
   is in effect.  The default is to return false to use ``__cxa_atexit``.
 
+.. hook-end
+
 .. function:: bool TARGET_CXX_USE_ATEXIT_FOR_CXA_ATEXIT (void)
 
+  .. hook-start:TARGET_CXX_USE_ATEXIT_FOR_CXA_ATEXIT
+
   This hook returns true if the target ``atexit`` function can be used
   in the same manner as ``__cxa_atexit`` to register C++ static
   destructors. This requires that ``atexit`` -registered functions in
   shared libraries are run in the correct order when the libraries are
   unloaded. The default is to return false.
 
+.. hook-end
+
 .. function:: void TARGET_CXX_ADJUST_CLASS_AT_DEFINITION (tree type)
 
+  .. hook-start:TARGET_CXX_ADJUST_CLASS_AT_DEFINITION
+
   :samp:`{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).
 
+.. hook-end
+
 .. function:: tree TARGET_CXX_DECL_MANGLING_CONTEXT (const_tree decl)
 
-  Return target-specific mangling context of :samp:`{decl}` or ``NULL_TREE``.
\ No newline at end of file
+  .. hook-start:TARGET_CXX_DECL_MANGLING_CONTEXT
+
+  Return target-specific mangling context of :samp:`{decl}` or ``NULL_TREE``.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/condition-code-status.rst b/gcc/doc/gccint/target-description-macros-and-functions/condition-code-status.rst
index 8e5cd693adf..35200408db8 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/condition-code-status.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/condition-code-status.rst
@@ -108,6 +108,8 @@ Representation of condition codes using registers
 
 .. function:: void TARGET_CANONICALIZE_COMPARISON (int *code, rtx *op0, rtx *op1, bool op0_preserve_value)
 
+  .. hook-start:TARGET_CANONICALIZE_COMPARISON
+
   On some machines not all possible comparisons are defined, but you can
   convert an invalid comparison into a valid one.  For example, the Alpha
   does not have a ``GT`` comparison, but you can use an ``LT``
@@ -128,6 +130,8 @@ Representation of condition codes using registers
   You need not to implement this hook if it would never change the
   comparison code or operands.
 
+.. hook-end
+
 .. c:macro:: REVERSIBLE_CC_MODE (mode)
 
   A C expression whose value is one if it is always safe to reverse a
@@ -163,6 +167,8 @@ Representation of condition codes using registers
 
 .. function:: bool TARGET_FIXED_CONDITION_CODE_REGS (unsigned int *p1, unsigned int *p2)
 
+  .. hook-start:TARGET_FIXED_CONDITION_CODE_REGS
+
   On targets which use a hard
   register rather than a pseudo-register to hold condition codes, the
   regular CSE passes are often not able to identify cases in which the
@@ -176,8 +182,12 @@ Representation of condition codes using registers
 
   The default version of this hook returns false.
 
+.. hook-end
+
 .. function:: machine_mode TARGET_CC_MODES_COMPATIBLE (machine_mode m1, machine_mode m2)
 
+  .. hook-start:TARGET_CC_MODES_COMPATIBLE
+
   On targets which use multiple condition code modes in class
   ``MODE_CC``, it is sometimes the case that a comparison can be
   validly done in more than one mode.  On such a system, define this
@@ -189,8 +199,14 @@ Representation of condition codes using registers
   same.  If they are, it returns that mode.  If they are different, it
   returns ``VOIDmode``.
 
+.. hook-end
+
 .. c:var:: unsigned int TARGET_FLAGS_REGNUM
 
+  .. hook-start:TARGET_FLAGS_REGNUM
+
   If the target has a dedicated flags register, and it needs to use the
   post-reload comparison elimination pass, or the delay slot filler pass,
-  then this value should be set appropriately.
\ No newline at end of file
+  then this value should be set appropriately.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/controlling-debugging-information-format.rst b/gcc/doc/gccint/target-description-macros-and-functions/controlling-debugging-information-format.rst
index 6ddcd7d0c07..55d5c46edd7 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/controlling-debugging-information-format.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/controlling-debugging-information-format.rst
@@ -317,10 +317,14 @@ Here are macros for DWARF output.
 
   .. function:: int TARGET_DWARF_CALLING_CONVENTION (const_tree function)
 
+    .. hook-start:TARGET_DWARF_CALLING_CONVENTION
+
     Define this to enable the dwarf attribute ``DW_AT_calling_convention`` to
     be emitted for each function.  Instead of an integer return the enum
     value for the ``DW_CC_`` tag.
 
+  .. hook-end
+
   To support optional call frame debugging information, you must also
   define ``INCOMING_RETURN_ADDR_RTX`` and either set
   ``RTX_FRAME_RELATED_P`` on the prologue insns if you use RTL for the
@@ -337,6 +341,8 @@ Here are macros for DWARF output.
 
 .. function:: enum unwind_info_type TARGET_DEBUG_UNWIND_INFO (void)
 
+  .. hook-start:TARGET_DEBUG_UNWIND_INFO
+
   This hook defines the mechanism that will be used for describing frame
   unwind information to the debugger.  Normally the hook will return
   ``UI_DWARF2`` if DWARF 2 debug information is enabled, and
@@ -348,6 +354,8 @@ Here are macros for DWARF output.
   A target may return ``UI_TARGET`` if it has ABI specified unwind tables.
   This will suppress generation of the normal debug frame unwind information.
 
+.. hook-end
+
 .. c:macro:: DWARF2_ASM_LINE_DEBUG_INFO
 
   Define this macro to be a nonzero value if the assembler can generate Dwarf 2
@@ -363,6 +371,8 @@ Here are macros for DWARF output.
 
 .. function:: int TARGET_RESET_LOCATION_VIEW (rtx_insn *)
 
+  .. hook-start:TARGET_RESET_LOCATION_VIEW
+
   This hook, if defined, enables -ginternal-reset-location-views, and
   uses its result to override cases in which the estimated min insn
   length might be nonzero even when a PC advance (i.e., a view reset)
@@ -377,28 +387,46 @@ Here are macros for DWARF output.
   If insn length is to be regarded as reliable, set the hook to
   ``hook_int_rtx_insn_0``.
 
+.. hook-end
+
 .. c:var:: bool TARGET_WANT_DEBUG_PUB_SECTIONS
 
+  .. hook-start:TARGET_WANT_DEBUG_PUB_SECTIONS
+
   True if the ``.debug_pubtypes`` and ``.debug_pubnames`` sections
   should be emitted.  These sections are not used on most platforms, and
   in particular GDB does not use them.
 
+.. hook-end
+
 .. c:var:: bool TARGET_DELAY_SCHED2
 
+  .. hook-start:TARGET_DELAY_SCHED2
+
   True if sched2 is not to be run at its normal place.
   This usually means it will be run as part of machine-specific reorg.
 
+.. hook-end
+
 .. c:var:: bool TARGET_DELAY_VARTRACK
 
+  .. hook-start:TARGET_DELAY_VARTRACK
+
   True if vartrack is not to be run at its normal place.
   This usually means it will be run as part of machine-specific reorg.
 
+.. hook-end
+
 .. c:var:: bool TARGET_NO_REGISTER_ALLOCATION
 
+  .. hook-start:TARGET_NO_REGISTER_ALLOCATION
+
   True if register allocation and the passes
   following it should not be run.  Usually true only for virtual assembler
   targets.
 
+.. hook-end
+
 .. c:macro:: ASM_OUTPUT_DWARF_DELTA (stream, size, label1, label2)
 
   A C statement to issue assembly directives that create a difference
@@ -436,9 +464,13 @@ Here are macros for DWARF output.
 
 .. function:: void TARGET_ASM_OUTPUT_DWARF_DTPREL (FILE *file, int size, rtx x)
 
+  .. hook-start:TARGET_ASM_OUTPUT_DWARF_DTPREL
+
   If defined, this target hook is a function which outputs a DTP-relative
   reference to the given TLS symbol of the specified size.
 
+.. hook-end
+
 .. _vms-debug:
 
 Macros for VMS Debug Format
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/controlling-the-compilation-driver-gcc.rst b/gcc/doc/gccint/target-description-macros-and-functions/controlling-the-compilation-driver-gcc.rst
index 1148b50ca91..8f0f406488d 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/controlling-the-compilation-driver-gcc.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/controlling-the-compilation-driver-gcc.rst
@@ -295,11 +295,15 @@ You can control the compilation driver.
 
 .. c:var:: bool TARGET_ALWAYS_STRIP_DOTDOT
 
+  .. hook-start:TARGET_ALWAYS_STRIP_DOTDOT
+
   True if :samp:`..` components should always be removed from directory names
   computed relative to GCC's internal directories, false (default) if such
   components should be preserved and directory names containing them passed
   to other tools such as the linker.
 
+.. hook-end
+
 .. c:macro:: MULTILIB_DEFAULTS
 
   Define this macro as a C expression for the initializer of an array of
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/d-abi-parameters.rst b/gcc/doc/gccint/target-description-macros-and-functions/d-abi-parameters.rst
index 1f2c7800971..f9a8f9e4253 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/d-abi-parameters.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/d-abi-parameters.rst
@@ -12,18 +12,28 @@ D ABI parameters
 
 .. function:: void TARGET_D_CPU_VERSIONS (void)
 
+  .. hook-start:TARGET_D_CPU_VERSIONS
+
   Declare all environmental version identifiers relating to the target CPU
   using the function ``builtin_version``, which takes a string representing
   the name of the version.  Version identifiers predefined by this hook apply
   to all modules that are being compiled and imported.
 
+.. hook-end
+
 .. function:: void TARGET_D_OS_VERSIONS (void)
 
+  .. hook-start:TARGET_D_OS_VERSIONS
+
   Similarly to ``TARGET_D_CPU_VERSIONS``, but is used for versions
   relating to the target operating system.
 
+.. hook-end
+
 .. function:: void TARGET_D_REGISTER_CPU_TARGET_INFO (void)
 
+  .. hook-start:TARGET_D_REGISTER_CPU_TARGET_INFO
+
   Register all target information keys relating to the target CPU using the
   function ``d_add_target_info_handlers``, which takes a
   :samp:`struct d_target_info_spec` (defined in :samp:`d/d-target.h`).  The keys
@@ -31,41 +41,67 @@ D ABI parameters
   ``__traits(getTargetInfo)`` extension, the result is an expression
   describing the requested target information.
 
+.. hook-end
+
 .. function:: void TARGET_D_REGISTER_OS_TARGET_INFO (void)
 
+  .. hook-start:TARGET_D_REGISTER_OS_TARGET_INFO
+
   Same as ``TARGET_D_CPU_TARGET_INFO``, but is used for keys relating to
   the target operating system.
 
+.. hook-end
+
 .. c:var:: const char * TARGET_D_MINFO_SECTION
 
+  .. hook-start:TARGET_D_MINFO_SECTION
+
   Contains the name of the section in which module info references should be
   placed.  This section is expected to be bracketed by two symbols to indicate
   the start and end address of the section, so that the runtime library can
   collect all modules for each loaded shared library and executable.  The
   default value of ``NULL`` disables the use of sections altogether.
 
+.. hook-end
+
 .. c:var:: const char * TARGET_D_MINFO_START_NAME
 
+  .. hook-start:TARGET_D_MINFO_START_NAME
+
   If ``TARGET_D_MINFO_SECTION`` is defined, then this must also be defined
   as the name of the symbol indicating the start address of the module info
   section
 
+.. hook-end
+
 .. c:var:: const char * TARGET_D_MINFO_END_NAME
 
+  .. hook-start:TARGET_D_MINFO_END_NAME
+
   If ``TARGET_D_MINFO_SECTION`` is defined, then this must also be defined
   as the name of the symbol indicating the end address of the module info
   section
 
+.. hook-end
+
 .. function:: bool TARGET_D_HAS_STDCALL_CONVENTION (unsigned int *link_system, unsigned int *link_windows)
 
+  .. hook-start:TARGET_D_HAS_STDCALL_CONVENTION
+
   Returns ``true`` if the target supports the stdcall calling convention.
   The hook should also set :samp:`{link_system}` to ``1`` if the ``stdcall``
   attribute should be applied to functions with ``extern(System)`` linkage,
   and :samp:`{link_windows}` to ``1`` to apply ``stdcall`` to functions with
   ``extern(Windows)`` linkage.
 
+.. hook-end
+
 .. c:var:: bool TARGET_D_TEMPLATES_ALWAYS_COMDAT
 
+  .. hook-start:TARGET_D_TEMPLATES_ALWAYS_COMDAT
+
   This flag is true if instantiated functions and variables are always COMDAT
   if they have external linkage.  If this flag is false, then instantiated
-  decls will be emitted as weak symbols.  The default is ``false``.
\ No newline at end of file
+  decls will be emitted as weak symbols.  The default is ``false``.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/defining-target-specific-uses-of-attribute.rst b/gcc/doc/gccint/target-description-macros-and-functions/defining-target-specific-uses-of-attribute.rst
index b057edef535..0ba33fc67bc 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/defining-target-specific-uses-of-attribute.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/defining-target-specific-uses-of-attribute.rst
@@ -20,35 +20,53 @@ be documented in :samp:`extend.texi`.
 
 .. c:var:: const struct attribute_spec * TARGET_ATTRIBUTE_TABLE
 
+  .. hook-start:TARGET_ATTRIBUTE_TABLE
+
   If defined, this target hook points to an array of :samp:`struct
   attribute_spec` (defined in :samp:`tree-core.h`) specifying the machine
   specific attributes for this target and some of the restrictions on the
   entities to which these attributes are applied and the arguments they
   take.
 
+.. hook-end
+
 .. function:: bool TARGET_ATTRIBUTE_TAKES_IDENTIFIER_P (const_tree name)
 
+  .. hook-start:TARGET_ATTRIBUTE_TAKES_IDENTIFIER_P
+
   If defined, this target hook is a function which returns true if the
   machine-specific attribute named :samp:`{name}` expects an identifier
   given as its first argument to be passed on as a plain identifier, not
   subjected to name lookup.  If this is not defined, the default is
   false for all machine-specific attributes.
 
+.. hook-end
+
 .. function:: int TARGET_COMP_TYPE_ATTRIBUTES (const_tree type1, const_tree type2)
 
+  .. hook-start:TARGET_COMP_TYPE_ATTRIBUTES
+
   If defined, this target hook is a function which returns zero if the attributes on
   :samp:`{type1}` and :samp:`{type2}` are incompatible, one if they are compatible,
   and two if they are nearly compatible (which causes a warning to be
   generated).  If this is not defined, machine-specific attributes are
   supposed always to be compatible.
 
+.. hook-end
+
 .. function:: void TARGET_SET_DEFAULT_TYPE_ATTRIBUTES (tree type)
 
+  .. hook-start:TARGET_SET_DEFAULT_TYPE_ATTRIBUTES
+
   If defined, this target hook is a function which assigns default attributes to
   the newly defined :samp:`{type}`.
 
+.. hook-end
+
 .. function:: tree TARGET_MERGE_TYPE_ATTRIBUTES (tree type1, tree type2)
 
+  .. hook-start:TARGET_MERGE_TYPE_ATTRIBUTES
+
   Define this target hook if the merging of type attributes needs special
   handling.  If defined, the result is a list of the combined
   ``TYPE_ATTRIBUTES`` of :samp:`{type1}` and :samp:`{type2}`.  It is assumed
@@ -56,8 +74,12 @@ be documented in :samp:`extend.texi`.
   function may call ``merge_attributes`` to handle machine-independent
   merging.
 
+.. hook-end
+
 .. function:: tree TARGET_MERGE_DECL_ATTRIBUTES (tree olddecl, tree newdecl)
 
+  .. hook-start:TARGET_MERGE_DECL_ATTRIBUTES
+
   Define this target hook if the merging of decl attributes needs special
   handling.  If defined, the result is a list of the combined
   ``DECL_ATTRIBUTES`` of :samp:`{olddecl}` and :samp:`{newdecl}`.
@@ -79,12 +101,18 @@ be documented in :samp:`extend.texi`.
   :samp:`dllexport` attributes.  This is done in :samp:`i386/cygwin.h` and
   :samp:`i386/i386.c`, for example.
 
+.. hook-end
+
 .. function:: bool TARGET_VALID_DLLIMPORT_ATTRIBUTE_P (const_tree decl)
 
+  .. hook-start:TARGET_VALID_DLLIMPORT_ATTRIBUTE_P
+
   :samp:`{decl}` is a variable or function with ``__attribute__((dllimport))``
   specified.  Use this hook if the target needs to add extra validation
   checks to ``handle_dll_attribute``.
 
+.. hook-end
+
 .. c:macro:: TARGET_DECLSPEC
 
   Define this macro to a nonzero value if you want to treat
@@ -96,6 +124,8 @@ be documented in :samp:`extend.texi`.
 
 .. function:: void TARGET_INSERT_ATTRIBUTES (tree node, tree *attr_ptr)
 
+  .. hook-start:TARGET_INSERT_ATTRIBUTES
+
   Define this target hook if you want to be able to add attributes to a decl
   when it is being created.  This is normally useful for back ends which
   wish to implement a pragma by using the attributes which correspond to
@@ -107,16 +137,24 @@ be documented in :samp:`extend.texi`.
   attributes, or a copy of the list may be made if further changes are
   needed.
 
+.. hook-end
+
 .. function:: tree TARGET_HANDLE_GENERIC_ATTRIBUTE (tree *node, tree name, tree args, int flags, bool *no_add_attrs)
 
+  .. hook-start:TARGET_HANDLE_GENERIC_ATTRIBUTE
+
   Define this target hook if you want to be able to perform additional
   target-specific processing of an attribute which is handled generically
   by a front end.  The arguments are the same as those which are passed to
   attribute handlers.  So far this only affects the :samp:`{noinit}` and
   :samp:`{section}` attribute.
 
+.. hook-end
+
 .. function:: bool TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P (const_tree fndecl)
 
+  .. hook-start:TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P
+
   .. index:: inlining
 
   This target hook returns ``true`` if it is OK to inline :samp:`{fndecl}`
@@ -124,8 +162,12 @@ be documented in :samp:`extend.texi`.
   attributes, ``false`` otherwise.  By default, if a function has a
   target specific attribute attached to it, it will not be inlined.
 
+.. hook-end
+
 .. function:: bool TARGET_OPTION_VALID_ATTRIBUTE_P (tree fndecl, tree name, tree args, int flags)
 
+  .. hook-start:TARGET_OPTION_VALID_ATTRIBUTE_P
+
   This hook is called to parse ``attribute(target("..."))``, which
   allows setting target-specific options on individual functions.
   These function-specific options may differ
@@ -136,40 +178,64 @@ be documented in :samp:`extend.texi`.
   the function declaration to hold a pointer to a target-specific
   ``struct cl_target_option`` structure.
 
+.. hook-end
+
 .. function:: void TARGET_OPTION_SAVE (struct cl_target_option *ptr, struct gcc_options *opts, struct gcc_options *opts_set)
 
+  .. hook-start:TARGET_OPTION_SAVE
+
   This hook is called to save any additional target-specific information
   in the ``struct cl_target_option`` structure for function-specific
   options from the ``struct gcc_options`` structure.
   See :ref:`option-file-format`.
 
+.. hook-end
+
 .. function:: void TARGET_OPTION_RESTORE (struct gcc_options *opts, struct gcc_options *opts_set, struct cl_target_option *ptr)
 
+  .. hook-start:TARGET_OPTION_RESTORE
+
   This hook is called to restore any additional target-specific
   information in the ``struct cl_target_option`` structure for
   function-specific options to the ``struct gcc_options`` structure.
 
+.. hook-end
+
 .. function:: void TARGET_OPTION_POST_STREAM_IN (struct cl_target_option *ptr)
 
+  .. hook-start:TARGET_OPTION_POST_STREAM_IN
+
   This hook is called to update target-specific information in the
   ``struct cl_target_option`` structure after it is streamed in from
   LTO bytecode.
 
+.. hook-end
+
 .. function:: void TARGET_OPTION_PRINT (FILE *file, int indent, struct cl_target_option *ptr)
 
+  .. hook-start:TARGET_OPTION_PRINT
+
   This hook is called to print any additional target-specific
   information in the ``struct cl_target_option`` structure for
   function-specific options.
 
+.. hook-end
+
 .. function:: bool TARGET_OPTION_PRAGMA_PARSE (tree args, tree pop_target)
 
+  .. hook-start:TARGET_OPTION_PRAGMA_PARSE
+
   This target hook parses the options for ``#pragma GCC target``, which
   sets the target-specific options for functions that occur later in the
   input stream.  The options accepted should be the same as those handled by the
   ``TARGET_OPTION_VALID_ATTRIBUTE_P`` hook.
 
+.. hook-end
+
 .. function:: void TARGET_OPTION_OVERRIDE (void)
 
+  .. hook-start:TARGET_OPTION_OVERRIDE
+
   Sometimes certain combinations of command options do not make sense on
   a particular target machine.  You can override the hook
   ``TARGET_OPTION_OVERRIDE`` to take account of this.  This hooks is called
@@ -182,23 +248,37 @@ be documented in :samp:`extend.texi`.
   changed via the optimize attribute or pragma, see
   ``TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE``
 
+.. hook-end
+
 .. function:: bool TARGET_OPTION_FUNCTION_VERSIONS (tree decl1, tree decl2)
 
+  .. hook-start:TARGET_OPTION_FUNCTION_VERSIONS
+
   This target hook returns ``true`` if :samp:`{DECL1}` and :samp:`{DECL2}` are
   versions of the same function.  :samp:`{DECL1}` and :samp:`{DECL2}` are function
   versions if and only if they have the same function signature and
   different target specific attributes, that is, they are compiled for
   different target machines.
 
+.. hook-end
+
 .. function:: bool TARGET_CAN_INLINE_P (tree caller, tree callee)
 
+  .. hook-start:TARGET_CAN_INLINE_P
+
   This target hook returns ``false`` if the :samp:`{caller}` function
   cannot inline :samp:`{callee}`, based on target specific information.  By
   default, inlining is not allowed if the callee function has function
   specific target options and the caller does not use the same options.
 
+.. hook-end
+
 .. function:: void TARGET_RELAYOUT_FUNCTION (tree fndecl)
 
+  .. hook-start:TARGET_RELAYOUT_FUNCTION
+
   This target hook fixes function :samp:`{fndecl}` after attributes are processed.
   Default does nothing. On ARM, the default function's alignment is updated
-  with the attribute target.
\ No newline at end of file
+  with the attribute target.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/assembler-commands-for-exception-regions.rst b/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/assembler-commands-for-exception-regions.rst
index f85b8cef69e..8898a028c9f 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/assembler-commands-for-exception-regions.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/assembler-commands-for-exception-regions.rst
@@ -56,6 +56,10 @@ region.
 
 .. function:: enum unwind_info_type TARGET_EXCEPT_UNWIND_INFO (struct gcc_options *opts)
 
+  .. hook-start:TARGET_EXCEPT_UNWIND_INFO
+
+  .. hook-end
+
   This hook defines the mechanism that will be used for exception handling
   by the target.  If the target has ABI specified unwind tables, the hook
   should return ``UI_TARGET``.  If the target is to use the
@@ -82,6 +86,10 @@ region.
 
 .. c:var:: bool TARGET_UNWIND_TABLES_DEFAULT
 
+  .. hook-start:TARGET_UNWIND_TABLES_DEFAULT
+
+  .. hook-end
+
   This variable should be set to ``true`` if the target ABI requires unwinding
   tables even when exceptions are not used.  It must not be modified by
   command-line option processing.
@@ -111,13 +119,19 @@ region.
 
 .. c:var:: bool TARGET_TERMINATE_DW2_EH_FRAME_INFO
 
+  .. hook-start:TARGET_TERMINATE_DW2_EH_FRAME_INFO
+
   Contains the value true if the target should add a zero word onto the
   end of a Dwarf-2 frame info section when used for exception handling.
   Default value is false if ``EH_FRAME_SECTION_NAME`` is defined, and
   true otherwise.
 
+.. hook-end
+
 .. function:: rtx TARGET_DWARF_REGISTER_SPAN (rtx reg)
 
+  .. hook-start:TARGET_DWARF_REGISTER_SPAN
+
   Given a register, this hook should return a parallel of registers to
   represent where to find the register pieces.  Define this hook if the
   register and its mode are represented in Dwarf in non-contiguous
@@ -125,15 +139,23 @@ region.
   register in Dwarf.  Otherwise, this hook should return ``NULL_RTX``.
   If not defined, the default is to return ``NULL_RTX``.
 
+.. hook-end
+
 .. function:: machine_mode TARGET_DWARF_FRAME_REG_MODE (int regno)
 
+  .. hook-start:TARGET_DWARF_FRAME_REG_MODE
+
   Given a register, this hook should return the mode which the
   corresponding Dwarf frame register should have.  This is normally
   used to return a smaller mode than the raw mode to prevent call
   clobbered parts of a register altering the frame register size
 
+.. hook-end
+
 .. function:: void TARGET_INIT_DWARF_REG_SIZES_EXTRA (tree address)
 
+  .. hook-start:TARGET_INIT_DWARF_REG_SIZES_EXTRA
+
   If some registers are represented in Dwarf-2 unwind information in
   multiple pieces, define this hook to fill in information about the
   sizes of those pieces in the table used by the unwinder at runtime.
@@ -141,16 +163,26 @@ region.
   filling in a single size corresponding to each hard register;
   :samp:`{address}` is the address of the table.
 
+.. hook-end
+
 .. function:: bool TARGET_ASM_TTYPE (rtx sym)
 
+  .. hook-start:TARGET_ASM_TTYPE
+
   This hook is used to output a reference from a frame unwinding table to
   the type_info object identified by :samp:`{sym}`.  It should return ``true``
   if the reference was output.  Returning ``false`` will cause the
   reference to be output using the normal Dwarf2 routines.
 
+.. hook-end
+
 .. c:var:: bool TARGET_ARM_EABI_UNWINDER
 
+  .. hook-start:TARGET_ARM_EABI_UNWINDER
+
   This flag should be set to ``true`` on targets that use an ARM EABI
   based unwinding library, and ``false`` on other targets.  This effects
   the format of unwinding tables, and how the unwinder in entered after
-  running a cleanup.  The default is ``false``.
\ No newline at end of file
+  running a cleanup.  The default is ``false``.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/macros-controlling-initialization-routines.rst b/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/macros-controlling-initialization-routines.rst
index e0f46aaa73c..8ec77632e83 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/macros-controlling-initialization-routines.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/macros-controlling-initialization-routines.rst
@@ -73,12 +73,18 @@ and termination functions:
 
 .. c:var:: bool TARGET_HAVE_CTORS_DTORS
 
+  .. hook-start:TARGET_HAVE_CTORS_DTORS
+
   This value is true if the target supports some 'native' method of
   collecting constructors and destructors to be run at startup and exit.
   It is false if we must use :command:`collect2`.
 
+.. hook-end
+
 .. function:: void TARGET_ASM_CONSTRUCTOR (rtx symbol, int priority)
 
+  .. hook-start:TARGET_ASM_CONSTRUCTOR
+
   If defined, a function that outputs assembler code to arrange to call
   the function referenced by :samp:`{symbol}` at initialization time.
 
@@ -92,11 +98,17 @@ and termination functions:
   target defines ``CTORS_SECTION_ASM_OP``, or (3) ``USE_COLLECT2``
   is not defined.
 
+.. hook-end
+
 .. function:: void TARGET_ASM_DESTRUCTOR (rtx symbol, int priority)
 
+  .. hook-start:TARGET_ASM_DESTRUCTOR
+
   This is like ``TARGET_ASM_CONSTRUCTOR`` but used for termination
   functions rather than initialization functions.
 
+.. hook-end
+
 If ``TARGET_HAVE_CTORS_DTORS`` is true, the initialization routine
 generated for the generated object file will have static linkage.
 
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/output-and-generation-of-labels.rst b/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/output-and-generation-of-labels.rst
index 5e9edcb5f3b..42c58b17f00 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/output-and-generation-of-labels.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/output-and-generation-of-labels.rst
@@ -201,6 +201,8 @@ This is about outputting labels.
 
 .. function:: void TARGET_ASM_DECLARE_CONSTANT_NAME (FILE *file, const char *name, const_tree expr, HOST_WIDE_INT size)
 
+  .. hook-start:TARGET_ASM_DECLARE_CONSTANT_NAME
+
   A target hook to output to the stdio stream :samp:`{file}` any text necessary
   for declaring the name :samp:`{name}` of a constant which is being defined.  This
   target hook is responsible for outputting the label definition (perhaps using
@@ -213,6 +215,8 @@ This is about outputting labels.
 
   You may wish to use ``ASM_OUTPUT_TYPE_DIRECTIVE`` in this target hook.
 
+.. hook-end
+
 .. c:macro:: ASM_DECLARE_REGISTER_GLOBAL (stream, decl, regno, name)
 
   A C statement (sans semicolon) to output to the stdio stream
@@ -238,6 +242,8 @@ This is about outputting labels.
 
 .. function:: void TARGET_ASM_GLOBALIZE_LABEL (FILE *stream, const char *name)
 
+  .. hook-start:TARGET_ASM_GLOBALIZE_LABEL
+
   This target hook is a function to output to the stdio stream
   :samp:`{stream}` some commands that will make the label :samp:`{name}` global;
   that is, available for reference from other files.
@@ -245,21 +251,31 @@ This is about outputting labels.
   The default implementation relies on a proper definition of
   ``GLOBAL_ASM_OP``.
 
+.. hook-end
+
 .. function:: void TARGET_ASM_GLOBALIZE_DECL_NAME (FILE *stream, tree decl)
 
+  .. hook-start:TARGET_ASM_GLOBALIZE_DECL_NAME
+
   This target hook is a function to output to the stdio stream
   :samp:`{stream}` some commands that will make the name associated with :samp:`{decl}`
   global; that is, available for reference from other files.
 
   The default implementation uses the TARGET_ASM_GLOBALIZE_LABEL target hook.
 
+.. hook-end
+
 .. function:: void TARGET_ASM_ASSEMBLE_UNDEFINED_DECL (FILE *stream, const char *name, const_tree decl)
 
+  .. hook-start:TARGET_ASM_ASSEMBLE_UNDEFINED_DECL
+
   This target hook is a function to output to the stdio stream
   :samp:`{stream}` some commands that will declare the name associated with
   :samp:`{decl}` which is not defined in the current translation unit.  Most
   assemblers do not require anything to be output in this case.
 
+.. hook-end
+
 .. c:macro:: ASM_WEAKEN_LABEL (stream, name)
 
   A C statement (sans semicolon) to output to the stdio stream
@@ -331,10 +347,14 @@ This is about outputting labels.
 
 .. function:: void TARGET_ASM_ASSEMBLE_VISIBILITY (tree decl, int visibility)
 
+  .. hook-start:TARGET_ASM_ASSEMBLE_VISIBILITY
+
   This target hook is a function to output to :samp:`{asm_out_file}` some
   commands that will make the symbol(s) associated with :samp:`{decl}` have
   hidden, protected or internal visibility as specified by :samp:`{visibility}`.
 
+.. hook-end
+
 .. c:macro:: TARGET_WEAK_NOT_IN_ARCHIVE_TOC
 
   A C expression that evaluates to true if the target's linker expects
@@ -367,16 +387,24 @@ This is about outputting labels.
 
 .. function:: void TARGET_ASM_EXTERNAL_LIBCALL (rtx symref)
 
+  .. hook-start:TARGET_ASM_EXTERNAL_LIBCALL
+
   This target hook is a function to output to :samp:`{asm_out_file}` an assembler
   pseudo-op to declare a library function name external.  The name of the
   library function is given by :samp:`{symref}`, which is a ``symbol_ref``.
 
+.. hook-end
+
 .. function:: void TARGET_ASM_MARK_DECL_PRESERVED (const char *symbol)
 
+  .. hook-start:TARGET_ASM_MARK_DECL_PRESERVED
+
   This target hook is a function to output to :samp:`{asm_out_file}` an assembler
   directive to annotate :samp:`{symbol}` as used.  The Darwin target uses the
   .no_dead_code_strip directive.
 
+.. hook-end
+
 .. c:macro:: ASM_OUTPUT_LABELREF (stream, name)
 
   A C statement (sans semicolon) to output to the stdio stream
@@ -387,12 +415,16 @@ This is about outputting labels.
 
 .. function:: tree TARGET_MANGLE_ASSEMBLER_NAME (const char *name)
 
+  .. hook-start:TARGET_MANGLE_ASSEMBLER_NAME
+
   Given a symbol :samp:`{name}`, perform same mangling as ``varasm.c`` 's
   ``assemble_name``, but in memory rather than to a file stream, returning
   result as an ``IDENTIFIER_NODE``.  Required for correct LTO symtabs.  The
   default implementation calls the ``TARGET_STRIP_NAME_ENCODING`` hook and
   then prepends the ``USER_LABEL_PREFIX``, if any.
 
+.. hook-end
+
 .. c:macro:: ASM_OUTPUT_SYMBOL_REF (stream, sym)
 
   A C statement (sans semicolon) to output a reference to
@@ -413,6 +445,8 @@ This is about outputting labels.
 
 .. function:: void TARGET_ASM_INTERNAL_LABEL (FILE *stream, const char *prefix, unsigned long labelno)
 
+  .. hook-start:TARGET_ASM_INTERNAL_LABEL
+
   A function to output to the stdio stream :samp:`{stream}` a label whose
   name is made from the string :samp:`{prefix}` and the number :samp:`{labelno}`.
 
@@ -428,6 +462,8 @@ This is about outputting labels.
 
   The default version of this function utilizes ``ASM_GENERATE_INTERNAL_LABEL``.
 
+.. hook-end
+
 .. c:macro:: ASM_OUTPUT_DEBUG_LABEL (stream, prefix, num)
 
   A C statement to output to the stdio stream :samp:`{stream}` a debug info
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/output-of-assembler-instructions.rst b/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/output-of-assembler-instructions.rst
index e6268ac1878..95e8a4b96ec 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/output-of-assembler-instructions.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/output-of-assembler-instructions.rst
@@ -93,6 +93,8 @@ This describes assembler instruction output.
 
 .. function:: void TARGET_ASM_FINAL_POSTSCAN_INSN (FILE *file, rtx_insn *insn, rtx *opvec, int noperands)
 
+  .. hook-start:TARGET_ASM_FINAL_POSTSCAN_INSN
+
   If defined, this target hook is a function which is executed just after the
   output of assembler code for :samp:`{insn}`, to change the mode of the assembler
   if necessary.
@@ -104,6 +106,8 @@ This describes assembler instruction output.
   template into assembler code, so you can change the assembler mode
   by checking the contents of the vector.
 
+.. hook-end
+
 .. c:macro:: PRINT_OPERAND (stream, x, code)
 
   A C compound statement to output to stdio stream :samp:`{stream}` the
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/output-of-data.rst b/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/output-of-data.rst
index 0552f127cf2..11fd65f9545 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/output-of-data.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/output-of-data.rst
@@ -10,33 +10,7 @@ Output of Data
 
 .. c:var:: const char * TARGET_ASM_BYTE_OP
 
-.. c:var:: const char * TARGET_ASM_ALIGNED_HI_OP
-
-.. c:var:: const char * TARGET_ASM_ALIGNED_PSI_OP
-
-.. c:var:: const char * TARGET_ASM_ALIGNED_SI_OP
-
-.. c:var:: const char * TARGET_ASM_ALIGNED_PDI_OP
-
-.. c:var:: const char * TARGET_ASM_ALIGNED_DI_OP
-
-.. c:var:: const char * TARGET_ASM_ALIGNED_PTI_OP
-
-.. c:var:: const char * TARGET_ASM_ALIGNED_TI_OP
-
-.. c:var:: const char * TARGET_ASM_UNALIGNED_HI_OP
-
-.. c:var:: const char * TARGET_ASM_UNALIGNED_PSI_OP
-
-.. c:var:: const char * TARGET_ASM_UNALIGNED_SI_OP
-
-.. c:var:: const char * TARGET_ASM_UNALIGNED_PDI_OP
-
-.. c:var:: const char * TARGET_ASM_UNALIGNED_DI_OP
-
-.. c:var:: const char * TARGET_ASM_UNALIGNED_PTI_OP
-
-.. c:var:: const char * TARGET_ASM_UNALIGNED_TI_OP
+  .. hook-start:TARGET_ASM_BYTE_OP
 
   These hooks specify assembly directives for creating certain kinds
   of integer object.  The ``TARGET_ASM_BYTE_OP`` directive creates a
@@ -48,8 +22,12 @@ Output of Data
   followed immediately by the object's initial value.  In most cases,
   the string should contain a tab, a pseudo-op, and then another tab.
 
+.. hook-end
+
 .. function:: bool TARGET_ASM_INTEGER (rtx x, unsigned int size, int aligned_p)
 
+  .. hook-start:TARGET_ASM_INTEGER
+
   The ``assemble_integer`` function uses this hook to output an
   integer object.  :samp:`{x}` is the object's value, :samp:`{size}` is its size
   in bytes and :samp:`{aligned_p}` indicates whether it is aligned.  The
@@ -61,13 +39,21 @@ Output of Data
   ``TARGET_ASM_BYTE_OP`` family of strings, returning ``false``
   when the relevant string is ``NULL``.
 
+.. hook-end
+
 .. function:: void TARGET_ASM_DECL_END (void)
 
+  .. hook-start:TARGET_ASM_DECL_END
+
   Define this hook if the target assembler requires a special marker to
   terminate an initialized variable declaration.
 
+.. hook-end
+
 .. function:: bool TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA (FILE *file, rtx x)
 
+  .. hook-start:TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA
+
   A target hook to recognize :samp:`{rtx}` patterns that ``output_addr_const``
   can't deal with, and output assembly code to :samp:`{file}` corresponding to
   the pattern :samp:`{x}`.  This may be used to allow machine-dependent
@@ -78,6 +64,8 @@ Output of Data
   itself, by calling, for example, ``output_operand_lossage``, it may just
   return ``true``.
 
+.. hook-end
+
 .. c:macro:: ASM_OUTPUT_ASCII (stream, ptr, len)
 
   A C statement to output to the stdio stream :samp:`{stream}` an assembler
@@ -169,10 +157,14 @@ Output of Data
 
 .. c:var:: const char * TARGET_ASM_CLOSE_PAREN
 
+  .. hook-start:TARGET_ASM_OPEN_PAREN
+
   These target hooks are C string constants, describing the syntax in the
   assembler for grouping arithmetic expressions.  If not overridden, they
   default to normal parentheses, which is correct for most assemblers.
 
+.. hook-end
+
 These macros are provided by :samp:`real.h` for writing the definitions
 of ``ASM_OUTPUT_DOUBLE`` and the like:
 
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/output-of-dispatch-tables.rst b/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/output-of-dispatch-tables.rst
index b4c5801595d..f2238ead223 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/output-of-dispatch-tables.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/output-of-dispatch-tables.rst
@@ -77,6 +77,8 @@ This concerns dispatch tables.
 
 .. function:: void TARGET_ASM_POST_CFI_STARTPROC (FILE *, tree)
 
+  .. hook-start:TARGET_ASM_POST_CFI_STARTPROC
+
   This target hook is used to emit assembly strings required by the target
   after the .cfi_startproc directive.  The first argument is the file stream to
   write the strings to and the second argument is the function's declaration.  The
@@ -84,8 +86,12 @@ This concerns dispatch tables.
 
   The default is to not output any assembly strings.
 
+.. hook-end
+
 .. function:: void TARGET_ASM_EMIT_UNWIND_LABEL (FILE *stream, tree decl, int for_eh, int empty)
 
+  .. hook-start:TARGET_ASM_EMIT_UNWIND_LABEL
+
   This target hook emits a label at the beginning of each FDE.  It
   should be defined on targets where FDEs need special labels, and it
   should write the appropriate label, for the FDE associated with the
@@ -96,44 +102,70 @@ This concerns dispatch tables.
 
   The default is that FDEs are not given nonlocal labels.
 
+.. hook-end
+
 .. function:: void TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL (FILE *stream)
 
+  .. hook-start:TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL
+
   This target hook emits a label at the beginning of the exception table.
   It should be defined on targets where it is desirable for the table
   to be broken up according to function.
 
   The default is that no label is emitted.
 
+.. hook-end
+
 .. function:: void TARGET_ASM_EMIT_EXCEPT_PERSONALITY (rtx personality)
 
+  .. hook-start:TARGET_ASM_EMIT_EXCEPT_PERSONALITY
+
   If the target implements ``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.
 
+.. hook-end
+
 .. function:: void TARGET_ASM_UNWIND_EMIT (FILE *stream, rtx_insn *insn)
 
+  .. hook-start:TARGET_ASM_UNWIND_EMIT
+
   This target hook emits assembly directives required to unwind the
   given instruction.  This is only used when ``TARGET_EXCEPT_UNWIND_INFO``
   returns ``UI_TARGET``.
 
+.. hook-end
+
 .. function:: rtx TARGET_ASM_MAKE_EH_SYMBOL_INDIRECT (rtx origsymbol, bool pubvis)
 
+  .. hook-start:TARGET_ASM_MAKE_EH_SYMBOL_INDIRECT
+
   If necessary, modify personality and LSDA references to handle indirection.
   The original symbol is in ``origsymbol`` and if ``pubvis`` is true
   the symbol is visible outside the TU.
 
+.. hook-end
+
 .. c:var:: bool TARGET_ASM_UNWIND_EMIT_BEFORE_INSN
 
+  .. hook-start:TARGET_ASM_UNWIND_EMIT_BEFORE_INSN
+
   True if the ``TARGET_ASM_UNWIND_EMIT`` hook should be called before
   the assembly for :samp:`{insn}` has been emitted, false if the hook should
   be called afterward.
 
+.. hook-end
+
 .. function:: bool TARGET_ASM_SHOULD_RESTORE_CFA_STATE (void)
 
+  .. hook-start:TARGET_ASM_SHOULD_RESTORE_CFA_STATE
+
   For DWARF-based unwind frames, two CFI instructions provide for save and
   restore of register state.  GCC maintains the current frame address (CFA)
   separately from the register bank but the unwinder in libgcc preserves this
   state along with the registers (and this is expected by the code that writes
   the unwind frames).  This hook allows the target to specify that the CFA data
   is not saved/restored along with the registers by the target unwinder so that
-  suitable additional instructions should be emitted to restore it.
\ No newline at end of file
+  suitable additional instructions should be emitted to restore it.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/the-overall-framework-of-an-assembler-file.rst b/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/the-overall-framework-of-an-assembler-file.rst
index 747cc45f825..b1a40778930 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/the-overall-framework-of-an-assembler-file.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/defining-the-output-assembler-language/the-overall-framework-of-an-assembler-file.rst
@@ -20,6 +20,8 @@ This describes the overall framework of an assembly file.
 
 .. function:: void TARGET_ASM_FILE_START (void)
 
+  .. hook-start:TARGET_ASM_FILE_START
+
   Output to ``asm_out_file`` any text which the assembler expects to
   find at the beginning of a file.  The default behavior is controlled
   by two flags, documented below.  Unless your target's assembler is
@@ -27,8 +29,12 @@ This describes the overall framework of an assembly file.
   ``default_file_start`` at some point in your target hook.  This
   lets other target files rely on these variables.
 
+.. hook-end
+
 .. c:var:: bool TARGET_ASM_FILE_START_APP_OFF
 
+  .. hook-start:TARGET_ASM_FILE_START_APP_OFF
+
   If this flag is true, the text of the macro ``ASM_APP_OFF`` will be
   printed as the very first line in the assembly file, unless
   :option:`-fverbose-asm` is in effect.  (If that macro has been defined
@@ -41,18 +47,28 @@ This describes the overall framework of an assembly file.
   verified that your port does not generate any extra whitespace or
   comments that will cause GAS to issue errors in NO_APP mode.
 
+.. hook-end
+
 .. c:var:: bool TARGET_ASM_FILE_START_FILE_DIRECTIVE
 
+  .. hook-start:TARGET_ASM_FILE_START_FILE_DIRECTIVE
+
   If this flag is true, ``output_file_directive`` will be called
   for the primary source file, immediately after printing
   ``ASM_APP_OFF`` (if that is enabled).  Most ELF assemblers expect
   this to be done.  The default is false.
 
+.. hook-end
+
 .. function:: void TARGET_ASM_FILE_END (void)
 
+  .. hook-start:TARGET_ASM_FILE_END
+
   Output to ``asm_out_file`` any text which the assembler expects
   to find at the end of a file.  The default is to output nothing.
 
+.. hook-end
+
 .. function:: void file_end_indicate_exec_stack ()
 
   Some systems use a common convention, the :samp:`.note.GNU-stack`
@@ -64,24 +80,36 @@ This describes the overall framework of an assembly file.
 
 .. function:: void TARGET_ASM_LTO_START (void)
 
+  .. hook-start:TARGET_ASM_LTO_START
+
   Output to ``asm_out_file`` any text which the assembler expects
   to find at the start of an LTO section.  The default is to output
   nothing.
 
+.. hook-end
+
 .. function:: void TARGET_ASM_LTO_END (void)
 
+  .. hook-start:TARGET_ASM_LTO_END
+
   Output to ``asm_out_file`` any text which the assembler expects
   to find at the end of an LTO section.  The default is to output
   nothing.
 
+.. hook-end
+
 .. function:: void TARGET_ASM_CODE_END (void)
 
+  .. hook-start:TARGET_ASM_CODE_END
+
   Output to ``asm_out_file`` any text which is needed before emitting
   unwind info and debug info at the end of a file.  Some targets emit
   here PIC setup thunks that cannot be emitted at the end of file,
   because they couldn't have unwind info then.  The default is to output
   nothing.
 
+.. hook-end
+
 .. c:macro:: ASM_COMMENT_START
 
   A C string constant describing how to begin a comment in the target
@@ -114,19 +142,27 @@ This describes the overall framework of an assembly file.
 
 .. function:: void TARGET_ASM_OUTPUT_SOURCE_FILENAME (FILE *file, const char *name)
 
+  .. hook-start:TARGET_ASM_OUTPUT_SOURCE_FILENAME
+
   Output DWARF debugging information which indicates that filename
   :samp:`{name}` is the current source file to the stdio stream :samp:`{file}`.
 
   This target hook need not be defined if the standard form of output
   for the file format in use is appropriate.
 
+.. hook-end
+
 .. function:: void TARGET_ASM_OUTPUT_IDENT (const char *name)
 
+  .. hook-start:TARGET_ASM_OUTPUT_IDENT
+
   Output a string based on :samp:`{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.
 
+.. hook-end
+
 .. c:macro:: OUTPUT_QUOTED_STRING (stream, string)
 
   A C statement to output the string :samp:`{string}` to the stdio stream
@@ -137,14 +173,20 @@ This describes the overall framework of an assembly file.
 
 .. function:: void TARGET_ASM_NAMED_SECTION (const char *name, unsigned int flags, tree decl)
 
+  .. hook-start:TARGET_ASM_NAMED_SECTION
+
   Output assembly directives to switch to section :samp:`{name}`.  The section
   should have attributes as specified by :samp:`{flags}`, which is a bit mask
   of the ``SECTION_*`` flags defined in :samp:`output.h`.  If :samp:`{decl}`
   is non-NULL, it is the ``VAR_DECL`` or ``FUNCTION_DECL`` with which
   this section is associated.
 
+.. hook-end
+
 .. function:: bool TARGET_ASM_ELF_FLAGS_NUMERIC (unsigned int flags, unsigned int *num)
 
+  .. hook-start:TARGET_ASM_ELF_FLAGS_NUMERIC
+
   This hook can be used to encode ELF section flags for which no letter
   code has been defined in the assembler.  It is called by
   ``default_asm_named_section`` whenever the section flags need to be
@@ -155,8 +197,12 @@ This describes the overall framework of an assembly file.
   returns false, then :samp:`{num}` is ignored and the traditional letter sequence
   is emitted.
 
+.. hook-end
+
 .. function:: section * TARGET_ASM_FUNCTION_SECTION (tree decl, enum node_frequency freq, bool startup, bool exit)
 
+  .. hook-start:TARGET_ASM_FUNCTION_SECTION
+
   Return preferred text (sub)section for function :samp:`{decl}`.
   Main purpose of this function is to separate cold, normal and hot
   functions. :samp:`{startup}` is true when function is known to be used only
@@ -165,27 +211,43 @@ This describes the overall framework of an assembly file.
   (from static destructors).
   Return NULL if function should go to default text section.
 
+.. hook-end
+
 .. function:: void TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS (FILE *file, tree decl, bool new_is_cold)
 
+  .. hook-start:TARGET_ASM_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 :samp:`{file}`.  The function
   decl is available as :samp:`{decl}` and the new section is 'cold' if
   :samp:`{new_is_cold}` is ``true``.
 
+.. hook-end
+
 .. c:var:: bool TARGET_HAVE_NAMED_SECTIONS
 
+  .. hook-start:TARGET_HAVE_NAMED_SECTIONS
+
+  .. hook-end
+
   This flag is true if the target supports ``TARGET_ASM_NAMED_SECTION``.
   It must not be modified by command-line option processing.
 
 .. c:var:: bool TARGET_HAVE_SWITCHABLE_BSS_SECTIONS
 
+  .. hook-start:TARGET_HAVE_SWITCHABLE_BSS_SECTIONS
+
   This flag is true if we can create zeroed data by switching to a BSS
   section and then using ``ASM_OUTPUT_SKIP`` to allocate the space.
   This is true on most ELF targets.
 
+.. hook-end
+
 .. function:: unsigned int TARGET_SECTION_TYPE_FLAGS (tree decl, const char *name, int reloc)
 
+  .. hook-start:TARGET_SECTION_TYPE_FLAGS
+
   Choose a set of section attributes for use by ``TARGET_ASM_NAMED_SECTION``
   based on a variable or function decl, a section name, and whether or not the
   declaration's initializer may contain runtime relocations.  :samp:`{decl}` may be
@@ -196,8 +258,12 @@ This describes the overall framework of an assembly file.
   need to override this if your target has special flags that might be
   set via ``__attribute__``.
 
+.. hook-end
+
 .. function:: void TARGET_ASM_RECORD_GCC_SWITCHES (const char *)
 
+  .. hook-start:TARGET_ASM_RECORD_GCC_SWITCHES
+
   Provides the target with the ability to record the gcc command line
   switches provided as argument.
 
@@ -208,8 +274,14 @@ This describes the overall framework of an assembly file.
   provided by the ``TARGET_ASM_RECORD_GCC_SWITCHES_SECTION`` target
   hook.
 
+.. hook-end
+
 .. c:var:: const char * TARGET_ASM_RECORD_GCC_SWITCHES_SECTION
 
+  .. hook-start:TARGET_ASM_RECORD_GCC_SWITCHES_SECTION
+
   This is the name of the section that will be created by the example
   ELF implementation of the ``TARGET_ASM_RECORD_GCC_SWITCHES`` target
-  hook.
\ No newline at end of file
+  hook.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/describing-relative-costs-of-operations.rst b/gcc/doc/gccint/target-description-macros-and-functions/describing-relative-costs-of-operations.rst
index 7fef221d17f..836475a2610 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/describing-relative-costs-of-operations.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/describing-relative-costs-of-operations.rst
@@ -41,6 +41,8 @@ on the target machine.
 
 .. function:: int TARGET_REGISTER_MOVE_COST (machine_mode mode, reg_class_t from, reg_class_t to)
 
+  .. hook-start:TARGET_REGISTER_MOVE_COST
+
   This target hook should return the cost of moving data of mode :samp:`{mode}`
   from a register in class :samp:`{from}` to one in class :samp:`{to}`.  The classes
   are expressed using the enumeration values such as ``GENERAL_REGS``.
@@ -60,6 +62,8 @@ on the target machine.
 
   The default version of this function returns 2.
 
+.. hook-end
+
 .. c:macro:: MEMORY_MOVE_COST (mode, class, in)
 
   A C expression for the cost of moving data of mode :samp:`{mode}` between a
@@ -89,6 +93,8 @@ on the target machine.
 
 .. function:: int TARGET_MEMORY_MOVE_COST (machine_mode mode, reg_class_t rclass, bool in)
 
+  .. hook-start:TARGET_MEMORY_MOVE_COST
+
   This target hook should return the cost of moving data of mode :samp:`{mode}`
   between a register of class :samp:`{rclass}` and memory; :samp:`{in}` is ``false``
   if the value is to be written to memory, ``true`` if it is to be read in.
@@ -111,6 +117,8 @@ on the target machine.
   value to the result of that function.  The arguments to that function
   are the same as to this target hook.
 
+.. hook-end
+
 .. c:macro:: BRANCH_COST (speed_p, predictable_p)
 
   A C expression for the cost of a branch instruction.  A value of 1 is
@@ -142,6 +150,8 @@ ordinarily expect.
 
 .. function:: bool TARGET_SLOW_UNALIGNED_ACCESS (machine_mode mode, unsigned int align)
 
+  .. hook-start:TARGET_SLOW_UNALIGNED_ACCESS
+
   This hook returns true if memory accesses described by the
   :samp:`{mode}` and :samp:`{alignment}` parameters have a cost many times greater
   than aligned accesses, for example if they are emulated in a trap handler.
@@ -157,6 +167,8 @@ ordinarily expect.
   The hook must return true whenever ``STRICT_ALIGNMENT`` is true.
   The default implementation returns ``STRICT_ALIGNMENT``.
 
+.. hook-end
+
 .. c:macro:: MOVE_RATIO (speed)
 
   The threshold of number of scalar memory-to-memory move insns, *below*
@@ -175,6 +187,8 @@ ordinarily expect.
 
 .. function:: bool TARGET_USE_BY_PIECES_INFRASTRUCTURE_P (unsigned HOST_WIDE_INT size, unsigned int alignment, enum by_pieces_operation op, bool speed_p)
 
+  .. hook-start:TARGET_USE_BY_PIECES_INFRASTRUCTURE_P
+
   GCC will attempt several strategies when asked to copy between
   two areas of memory, or to set, clear or store to memory, for example
   when copying a ``struct``. The ``by_pieces`` infrastructure
@@ -208,15 +222,23 @@ ordinarily expect.
   in code size, for example where the number of insns emitted to perform a
   move would be greater than that of a library call.
 
+.. hook-end
+
 .. function:: bool TARGET_OVERLAP_OP_BY_PIECES_P (void)
 
+  .. hook-start:TARGET_OVERLAP_OP_BY_PIECES_P
+
   This target hook should return true if when the ``by_pieces``
   infrastructure is used, an offset adjusted unaligned memory operation
   in the smallest integer mode for the last piece operation of a memory
   region can be generated to avoid doing more than one smaller operations.
 
+.. hook-end
+
 .. function:: int TARGET_COMPARE_BY_PIECES_BRANCH_RATIO (machine_mode mode)
 
+  .. hook-start:TARGET_COMPARE_BY_PIECES_BRANCH_RATIO
+
   When expanding a block comparison in MODE, gcc can try to reduce the
   number of branches at the expense of more memory operations.  This hook
   allows the target to override the default choice.  It should return the
@@ -225,6 +247,8 @@ ordinarily expect.
   particular mode from being used for block comparisons by returning a
   negative number from this hook.
 
+.. hook-end
+
 .. c:macro:: MOVE_MAX_PIECES
 
   A C expression used by ``move_by_pieces`` to determine the largest unit
@@ -328,6 +352,8 @@ ordinarily expect.
 
 .. function:: bool TARGET_OPTAB_SUPPORTED_P (int op, machine_mode mode1, machine_mode mode2, optimization_type opt_type)
 
+  .. hook-start:TARGET_OPTAB_SUPPORTED_P
+
   Return true if the optimizers should use optab :samp:`{op}` with
   modes :samp:`{mode1}` and :samp:`{mode2}` for optimization type :samp:`{opt_type}`.
   The optab is known to have an associated :samp:`.md` instruction
@@ -340,8 +366,12 @@ ordinarily expect.
 
   The default hook returns true for all inputs.
 
+.. hook-end
+
 .. function:: bool TARGET_RTX_COSTS (rtx x, machine_mode mode, int outer_code, int opno, int *total, bool speed)
 
+  .. hook-start:TARGET_RTX_COSTS
+
   This target hook describes the relative costs of RTL expressions.
 
   The cost may depend on the precise form of the expression, which is
@@ -372,8 +402,12 @@ ordinarily expect.
   The hook returns true when all subexpressions of :samp:`{x}` have been
   processed, and false when ``rtx_cost`` should recurse.
 
+.. hook-end
+
 .. function:: int TARGET_ADDRESS_COST (rtx address, machine_mode mode, addr_space_t as, bool speed)
 
+  .. hook-start:TARGET_ADDRESS_COST
+
   This hook computes the cost of an addressing mode that contains
   :samp:`{address}`.  If not defined, the cost is computed from
   the :samp:`{address}` expression and the ``TARGET_RTX_COST`` hook.
@@ -407,8 +441,12 @@ ordinarily expect.
   should probably only be given to addresses with different numbers of
   registers on machines with lots of registers.
 
+.. hook-end
+
 .. function:: int TARGET_INSN_COST (rtx_insn *insn, bool speed)
 
+  .. hook-start:TARGET_INSN_COST
+
   This target hook describes the relative costs of RTL instructions.
 
   In implementing this hook, you can use the construct
@@ -419,8 +457,12 @@ ordinarily expect.
   false, this target hook should be used to estimate the relative
   size cost of an expression, again relative to ``COSTS_N_INSNS``.
 
+.. hook-end
+
 .. function:: unsigned int TARGET_MAX_NOCE_IFCVT_SEQ_COST (edge e)
 
+  .. hook-start:TARGET_MAX_NOCE_IFCVT_SEQ_COST
+
   This hook returns a value in the same units as ``TARGET_RTX_COSTS``,
   giving the maximum acceptable cost for a sequence generated by the RTL
   if-conversion pass when conditional execution is not available.
@@ -439,21 +481,33 @@ ordinarily expect.
   ``max-rtl-if-conversion-[un]predictable`` parameters if they are set,
   and uses a multiple of ``BRANCH_COST`` otherwise.
 
+.. hook-end
+
 .. function:: bool TARGET_NOCE_CONVERSION_PROFITABLE_P (rtx_insn *seq, struct noce_if_info *if_info)
 
+  .. hook-start:TARGET_NOCE_CONVERSION_PROFITABLE_P
+
   This hook returns true if the instruction sequence ``seq`` is a good
   candidate as a replacement for the if-convertible sequence described in
   ``if_info``.
 
+.. hook-end
+
 .. function:: bool TARGET_NEW_ADDRESS_PROFITABLE_P (rtx memref, rtx_insn * insn, rtx new_addr)
 
+  .. hook-start:TARGET_NEW_ADDRESS_PROFITABLE_P
+
   Return ``true`` if it is profitable to replace the address in
   :samp:`{memref}` with :samp:`{new_addr}`.  This allows targets to prevent the
   scheduler from undoing address optimizations.  The instruction containing the
   memref is :samp:`{insn}`.  The default implementation returns ``true``.
 
+.. hook-end
+
 .. function:: bool TARGET_NO_SPECULATION_IN_DELAY_SLOTS_P (void)
 
+  .. hook-start:TARGET_NO_SPECULATION_IN_DELAY_SLOTS_P
+
   This predicate controls the use of the eager delay slot filler to disallow
   speculatively executed instructions being placed in delay slots.  Targets
   such as certain MIPS architectures possess both branches with and without
@@ -462,11 +516,17 @@ ordinarily expect.
   delay slot branches filled using the basic filler is often still desirable
   as the delay slot can hide a pipeline bubble.
 
+.. hook-end
+
 .. function:: HOST_WIDE_INT TARGET_ESTIMATED_POLY_VALUE (poly_int64 val, poly_value_estimate_kind kind)
 
+  .. hook-start:TARGET_ESTIMATED_POLY_VALUE
+
   Return an estimate of the runtime value of :samp:`{val}`, for use in
   things like cost calculations or profiling frequencies.  :samp:`{kind}` is used
   to ask for the minimum, maximum, and likely estimates of the value through
   the ``POLY_VALUE_MIN``, ``POLY_VALUE_MAX`` and
   ``POLY_VALUE_LIKELY`` values.  The default
-  implementation returns the lowest possible value of :samp:`{val}`.
\ No newline at end of file
+  implementation returns the lowest possible value of :samp:`{val}`.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/dividing-the-output-into-sections-texts-data.rst b/gcc/doc/gccint/target-description-macros-and-functions/dividing-the-output-into-sections-texts-data.rst
index e1a03834412..435a6c4bc7a 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/dividing-the-output-into-sections-texts-data.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/dividing-the-output-into-sections-texts-data.rst
@@ -11,6 +11,8 @@ Dividing the Output into Sections (Texts, Data, ...)
 .. the above section title is WAY too long.  maybe cut the part between
    the (...)?  -mew 10feb93
 
+.. the (...)?  -mew 10feb93
+
 An object file is divided into sections containing different types of
 data.  In the most common case, there are three sections: the :dfn:`text
 section`, which holds instructions and read-only data; the :dfn:`data
@@ -189,6 +191,8 @@ if the target does not provide them.
 
 .. function:: void TARGET_ASM_INIT_SECTIONS (void)
 
+  .. hook-start:TARGET_ASM_INIT_SECTIONS
+
   Define this hook if you need to do something special to set up the
   :samp:`varasm.c` sections, or if your target has some special sections
   of its own that you need to create.
@@ -197,8 +201,12 @@ if the target does not provide them.
   any assembly code, and before calling any of the section-returning hooks
   described below.
 
+.. hook-end
+
 .. function:: int TARGET_ASM_RELOC_RW_MASK (void)
 
+  .. hook-start:TARGET_ASM_RELOC_RW_MASK
+
   Return a mask describing how relocations should be treated when
   selecting sections.  Bit 1 should be set if global relocations
   should be placed in a read-write section; bit 0 should be set if
@@ -209,16 +217,24 @@ if the target does not provide them.
   when the target cannot support (some kinds of) dynamic relocations
   in read-only sections even in executables.
 
+.. hook-end
+
 .. function:: bool TARGET_ASM_GENERATE_PIC_ADDR_DIFF_VEC (void)
 
+  .. hook-start:TARGET_ASM_GENERATE_PIC_ADDR_DIFF_VEC
+
   Return true to generate ADDR_DIF_VEC table
   or false to generate ADDR_VEC table for jumps in case of -fPIC.
 
   The default version of this function returns true if flag_pic
   equals true and false otherwise
 
+.. hook-end
+
 .. function:: section * TARGET_ASM_SELECT_SECTION (tree exp, int reloc, unsigned HOST_WIDE_INT align)
 
+  .. hook-start:TARGET_ASM_SELECT_SECTION
+
   Return the section into which :samp:`{exp}` should be placed.  You can
   assume that :samp:`{exp}` is either a ``VAR_DECL`` node or a constant of
   some sort.  :samp:`{reloc}` indicates whether the initial value of :samp:`{exp}`
@@ -231,6 +247,8 @@ if the target does not provide them.
 
   See also :samp:`{USE_SELECT_SECTION_FOR_FUNCTIONS}`.
 
+.. hook-end
+
 .. c:macro:: USE_SELECT_SECTION_FOR_FUNCTIONS
 
   Define this macro if you wish TARGET_ASM_SELECT_SECTION to be called
@@ -242,6 +260,8 @@ if the target does not provide them.
 
 .. function:: void TARGET_ASM_UNIQUE_SECTION (tree decl, int reloc)
 
+  .. hook-start:TARGET_ASM_UNIQUE_SECTION
+
   Build up a unique section name, expressed as a ``STRING_CST`` node,
   and assign it to :samp:`DECL_SECTION_NAME ({decl})`.
   As with ``TARGET_ASM_SELECT_SECTION``, :samp:`{reloc}` indicates whether
@@ -252,8 +272,12 @@ if the target does not provide them.
   example, the function ``foo`` would be placed in ``.text.foo``.
   Whatever the actual target object format, this is often good enough.
 
+.. hook-end
+
 .. function:: section * TARGET_ASM_FUNCTION_RODATA_SECTION (tree decl, bool relocatable)
 
+  .. hook-start:TARGET_ASM_FUNCTION_RODATA_SECTION
+
   Return the readonly data or reloc readonly data section associated with
   :samp:`DECL_SECTION_NAME ({decl})`. :samp:`{relocatable}` selects the latter
   over the former.
@@ -262,19 +286,31 @@ if the target does not provide them.
   or ``.data.rel.ro.name`` if function is in ``.text.name``, and
   the normal readonly-data or reloc readonly data section otherwise.
 
+.. hook-end
+
 .. c:var:: const char * TARGET_ASM_MERGEABLE_RODATA_PREFIX
 
+  .. hook-start:TARGET_ASM_MERGEABLE_RODATA_PREFIX
+
   Usually, the compiler uses the prefix ``".rodata"`` to construct
   section names for mergeable constant data.  Define this macro to override
   the string if a different section name should be used.
 
+.. hook-end
+
 .. function:: section * TARGET_ASM_TM_CLONE_TABLE_SECTION (void)
 
+  .. hook-start:TARGET_ASM_TM_CLONE_TABLE_SECTION
+
   Return the section that should be used for transactional memory clone
   tables.
 
+.. hook-end
+
 .. function:: section * TARGET_ASM_SELECT_RTX_SECTION (machine_mode mode, rtx x, unsigned HOST_WIDE_INT align)
 
+  .. hook-start:TARGET_ASM_SELECT_RTX_SECTION
+
   Return the section into which a constant :samp:`{x}`, of mode :samp:`{mode}`,
   should be placed.  You can assume that :samp:`{x}` is some kind of
   constant in RTL.  The argument :samp:`{mode}` is redundant except in the
@@ -285,8 +321,12 @@ if the target does not provide them.
   constants in ``flag_pic`` mode in ``data_section`` and everything
   else in ``readonly_data_section``.
 
+.. hook-end
+
 .. function:: tree TARGET_MANGLE_DECL_ASSEMBLER_NAME (tree decl, tree id)
 
+  .. hook-start:TARGET_MANGLE_DECL_ASSEMBLER_NAME
+
   Define this hook if you need to postprocess the assembler name generated
   by target-independent code.  The :samp:`{id}` provided to this hook will be
   the computed name (e.g., the macro ``DECL_NAME`` of the :samp:`{decl}` in C,
@@ -295,8 +335,12 @@ if the target does not provide them.
   your target system.  The default implementation of this hook just
   returns the :samp:`{id}` provided.
 
+.. hook-end
+
 .. function:: void TARGET_ENCODE_SECTION_INFO (tree decl, rtx rtl, int new_decl_p)
 
+  .. hook-start:TARGET_ENCODE_SECTION_INFO
+
   Define this hook if references to a symbol or a constant must be
   treated differently depending on something about the variable or
   function named by the symbol (such as what section it is in).
@@ -334,31 +378,51 @@ if the target does not provide them.
   ``SYMBOL_REF_FLAGS``.  Check whether the default does what you need
   before overriding it.
 
+.. hook-end
+
 .. function:: const char * TARGET_STRIP_NAME_ENCODING (const char *name)
 
+  .. hook-start:TARGET_STRIP_NAME_ENCODING
+
   Decode :samp:`{name}` and return the real name part, sans
   the characters that ``TARGET_ENCODE_SECTION_INFO``
   may have added.
 
+.. hook-end
+
 .. function:: bool TARGET_IN_SMALL_DATA_P (const_tree exp)
 
+  .. hook-start:TARGET_IN_SMALL_DATA_P
+
   Returns true if :samp:`{exp}` should be placed into a 'small data' section.
   The default version of this hook always returns false.
 
+.. hook-end
+
 .. c:var:: bool TARGET_HAVE_SRODATA_SECTION
 
+  .. hook-start:TARGET_HAVE_SRODATA_SECTION
+
   Contains the value true if the target places read-only
   'small data' into a separate section.  The default value is false.
 
+.. hook-end
+
 .. function:: bool TARGET_PROFILE_BEFORE_PROLOGUE (void)
 
+  .. hook-start:TARGET_PROFILE_BEFORE_PROLOGUE
+
   It returns true if target wants profile code emitted before prologue.
 
   The default version of this hook use the target macro
   ``PROFILE_BEFORE_PROLOGUE``.
 
+.. hook-end
+
 .. function:: bool TARGET_BINDS_LOCAL_P (const_tree exp)
 
+  .. hook-start:TARGET_BINDS_LOCAL_P
+
   Returns true if :samp:`{exp}` names an object for which name resolution
   rules must resolve to the current 'module' (dynamic shared library
   or executable image).
@@ -367,7 +431,13 @@ if the target does not provide them.
   for ELF, which has a looser model of global name binding than other
   currently supported object file formats.
 
+.. hook-end
+
 .. c:var:: bool TARGET_HAVE_TLS
 
+  .. hook-start:TARGET_HAVE_TLS
+
   Contains the value true if the target supports thread-local storage.
-  The default value is false.
\ No newline at end of file
+  The default value is false.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/emulating-tls.rst b/gcc/doc/gccint/target-description-macros-and-functions/emulating-tls.rst
index 718b998a9e2..e203178d809 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/emulating-tls.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/emulating-tls.rst
@@ -24,62 +24,102 @@ address of the current thread's instance of the TLS object.
 
 .. c:var:: const char * TARGET_EMUTLS_GET_ADDRESS
 
+  .. hook-start:TARGET_EMUTLS_GET_ADDRESS
+
   Contains the name of the helper function that uses a TLS control
   object to locate a TLS instance.  The default causes libgcc's
   emulated TLS helper function to be used.
 
+.. hook-end
+
 .. c:var:: const char * TARGET_EMUTLS_REGISTER_COMMON
 
+  .. hook-start:TARGET_EMUTLS_REGISTER_COMMON
+
   Contains the name of the helper function that should be used at
   program startup to register TLS objects that are implicitly
   initialized to zero.  If this is ``NULL``, all TLS objects will
   have explicit initializers.  The default causes libgcc's emulated TLS
   registration function to be used.
 
+.. hook-end
+
 .. c:var:: const char * TARGET_EMUTLS_VAR_SECTION
 
+  .. hook-start:TARGET_EMUTLS_VAR_SECTION
+
   Contains the name of the section in which TLS control variables should
   be placed.  The default of ``NULL`` allows these to be placed in
   any section.
 
+.. hook-end
+
 .. c:var:: const char * TARGET_EMUTLS_TMPL_SECTION
 
+  .. hook-start:TARGET_EMUTLS_TMPL_SECTION
+
   Contains the name of the section in which TLS initializers should be
   placed.  The default of ``NULL`` allows these to be placed in any
   section.
 
+.. hook-end
+
 .. c:var:: const char * TARGET_EMUTLS_VAR_PREFIX
 
+  .. hook-start:TARGET_EMUTLS_VAR_PREFIX
+
   Contains the prefix to be prepended to TLS control variable names.
   The default of ``NULL`` uses a target-specific prefix.
 
+.. hook-end
+
 .. c:var:: const char * TARGET_EMUTLS_TMPL_PREFIX
 
+  .. hook-start:TARGET_EMUTLS_TMPL_PREFIX
+
   Contains the prefix to be prepended to TLS initializer objects.  The
   default of ``NULL`` uses a target-specific prefix.
 
+.. hook-end
+
 .. function:: tree TARGET_EMUTLS_VAR_FIELDS (tree type, tree *name)
 
+  .. hook-start:TARGET_EMUTLS_VAR_FIELDS
+
   Specifies a function that generates the FIELD_DECLs for a TLS control
   object type.  :samp:`{type}` is the RECORD_TYPE the fields are for and
   :samp:`{name}` should be filled with the structure tag, if the default of
   ``__emutls_object`` is unsuitable.  The default creates a type suitable
   for libgcc's emulated TLS function.
 
+.. hook-end
+
 .. function:: tree TARGET_EMUTLS_VAR_INIT (tree var, tree decl, tree tmpl_addr)
 
+  .. hook-start:TARGET_EMUTLS_VAR_INIT
+
   Specifies a function that generates the CONSTRUCTOR to initialize a
   TLS control object.  :samp:`{var}` is the TLS control object, :samp:`{decl}`
   is the TLS object and :samp:`{tmpl_addr}` is the address of the
   initializer.  The default initializes libgcc's emulated TLS control object.
 
+.. hook-end
+
 .. c:var:: bool TARGET_EMUTLS_VAR_ALIGN_FIXED
 
+  .. hook-start:TARGET_EMUTLS_VAR_ALIGN_FIXED
+
   Specifies whether the alignment of TLS control variable objects is
   fixed and should not be increased as some backends may do to optimize
   single objects.  The default is false.
 
+.. hook-end
+
 .. c:var:: bool TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS
 
+  .. hook-start:TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS
+
   Specifies whether a DWARF ``DW_OP_form_tls_address`` location descriptor
-  may be used to describe emulated TLS control objects.
\ No newline at end of file
+  may be used to describe emulated TLS control objects.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/implementing-the-varargs-macros.rst b/gcc/doc/gccint/target-description-macros-and-functions/implementing-the-varargs-macros.rst
index fe896b59e7e..d833e9a4cec 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/implementing-the-varargs-macros.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/implementing-the-varargs-macros.rst
@@ -78,14 +78,20 @@ These machine description macros help implement varargs:
 
 .. function:: rtx TARGET_EXPAND_BUILTIN_SAVEREGS (void)
 
+  .. hook-start:TARGET_EXPAND_BUILTIN_SAVEREGS
+
   If defined, this hook produces the machine-specific code for a call to
   ``__builtin_saveregs``.  This code will be moved to the very
   beginning of the function, before any parameter access are made.  The
   return value of this function should be an RTX that contains the value
   to use as the return of ``__builtin_saveregs``.
 
+.. hook-end
+
 .. function:: void TARGET_SETUP_INCOMING_VARARGS (cumulative_args_t args_so_far, const function_arg_info &arg, int *pretend_args_size, int second_time)
 
+  .. hook-start:TARGET_SETUP_INCOMING_VARARGS
+
   This target hook offers an alternative to using
   ``__builtin_saveregs`` and defining the hook
   ``TARGET_EXPAND_BUILTIN_SAVEREGS``.  Use it to store the anonymous
@@ -118,8 +124,12 @@ These machine description macros help implement varargs:
   end of the source file.  The hook ``TARGET_SETUP_INCOMING_VARARGS`` should
   not generate any instructions in this case.
 
+.. hook-end
+
 .. function:: bool TARGET_STRICT_ARGUMENT_NAMING (cumulative_args_t ca)
 
+  .. hook-start:TARGET_STRICT_ARGUMENT_NAMING
+
   Define this hook to return ``true`` if the location where a function
   argument is passed depends on whether or not it is a named argument.
 
@@ -133,8 +143,12 @@ These machine description macros help implement varargs:
 
   You need not define this hook if it always returns ``false``.
 
+.. hook-end
+
 .. function:: void TARGET_CALL_ARGS (rtx, tree)
 
+  .. hook-start:TARGET_CALL_ARGS
+
   While generating RTL for a function call, this target hook is invoked once
   for each argument passed to the function, either a register returned by
   ``TARGET_FUNCTION_ARG`` or a memory location.  It is called just
@@ -148,16 +162,24 @@ These machine description macros help implement varargs:
   passed instead of an argument register.
   Most ports do not need to implement anything for this hook.
 
+.. hook-end
+
 .. function:: void TARGET_END_CALL_ARGS (void)
 
+  .. hook-start:TARGET_END_CALL_ARGS
+
   This target hook is invoked while generating RTL for a function call,
   just after the point where the return reg is copied into a pseudo.  It
   signals that all the call argument and return registers for the just
   emitted call are now no longer in use.
   Most ports do not need to implement anything for this hook.
 
+.. hook-end
+
 .. function:: bool TARGET_PRETEND_OUTGOING_VARARGS_NAMED (cumulative_args_t ca)
 
+  .. hook-start:TARGET_PRETEND_OUTGOING_VARARGS_NAMED
+
   If you need to conditionally change ABIs so that one works with
   ``TARGET_SETUP_INCOMING_VARARGS``, but the other works like neither
   ``TARGET_SETUP_INCOMING_VARARGS`` nor ``TARGET_STRICT_ARGUMENT_NAMING`` was
@@ -165,8 +187,12 @@ These machine description macros help implement varargs:
   ``TARGET_SETUP_INCOMING_VARARGS`` is used, ``false`` otherwise.
   Otherwise, you should not define this hook.
 
+.. hook-end
+
 .. function:: rtx TARGET_LOAD_BOUNDS_FOR_ARG (rtx slot, rtx arg, rtx slot_no)
 
+  .. hook-start:TARGET_LOAD_BOUNDS_FOR_ARG
+
   This hook is used by expand pass to emit insn to load bounds of
   :samp:`{arg}` passed in :samp:`{slot}`.  Expand pass uses this hook in case
   bounds of :samp:`{arg}` are not passed in register.  If :samp:`{slot}` is a
@@ -175,8 +201,12 @@ These machine description macros help implement varargs:
   constant holding number of the target dependent special slot which
   should be used to obtain bounds.  Hook returns RTX holding loaded bounds.
 
+.. hook-end
+
 .. function:: void TARGET_STORE_BOUNDS_FOR_ARG (rtx arg, rtx slot, rtx bounds, rtx slot_no)
 
+  .. hook-start:TARGET_STORE_BOUNDS_FOR_ARG
+
   This hook is used by expand pass to emit insns to store :samp:`{bounds}` of
   :samp:`{arg}` passed in :samp:`{slot}`.  Expand pass uses this hook in case
   :samp:`{bounds}` of :samp:`{arg}` are not passed in register.  If :samp:`{slot}` is a
@@ -185,13 +215,23 @@ These machine description macros help implement varargs:
   constant holding number of the target dependent special slot which
   should be used to store :samp:`{bounds}`.
 
+.. hook-end
+
 .. function:: rtx TARGET_LOAD_RETURNED_BOUNDS (rtx slot)
 
+  .. hook-start:TARGET_LOAD_RETURNED_BOUNDS
+
   This hook is used by expand pass to emit insn to load bounds
   returned by function call in :samp:`{slot}`.  Hook returns RTX holding
   loaded bounds.
 
+.. hook-end
+
 .. function:: void TARGET_STORE_RETURNED_BOUNDS (rtx slot, rtx bounds)
 
+  .. hook-start:TARGET_STORE_RETURNED_BOUNDS
+
   This hook is used by expand pass to emit insn to store :samp:`{bounds}`
-  returned by function call into :samp:`{slot}`.
\ No newline at end of file
+  returned by function call into :samp:`{slot}`.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/implicit-calls-to-library-routines.rst b/gcc/doc/gccint/target-description-macros-and-functions/implicit-calls-to-library-routines.rst
index ab1413ddaa1..383ae5d7a2e 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/implicit-calls-to-library-routines.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/implicit-calls-to-library-routines.rst
@@ -29,6 +29,8 @@ Here is an explanation of implicit calls to library routines.
 
 .. function:: void TARGET_INIT_LIBFUNCS (void)
 
+  .. hook-start:TARGET_INIT_LIBFUNCS
+
   This hook should declare additional library routines or rename
   existing ones, using the functions ``set_optab_libfunc`` and
   ``init_one_libfunc`` defined in :samp:`optabs.c`.
@@ -37,8 +39,12 @@ Here is an explanation of implicit calls to library routines.
 
   The default is to do nothing.  Most ports don't need to define this hook.
 
+.. hook-end
+
 .. c:var:: bool TARGET_LIBFUNC_GNU_PREFIX
 
+  .. hook-start:TARGET_LIBFUNC_GNU_PREFIX
+
   If false (the default), internal library routines start with two
   underscores.  If set to true, these routines start with ``__gnu_``
   instead.  E.g., ``__muldi3`` changes to ``__gnu_muldi3``.  This
@@ -46,6 +52,8 @@ Here is an explanation of implicit calls to library routines.
   is set to true, the :samp:`tm.h` file must also
   ``#define LIBGCC2_GNU_PREFIX``.
 
+.. hook-end
+
 .. c:macro:: FLOAT_LIB_COMPARE_RETURNS_BOOL (mode, comparison)
 
   This macro should return ``true`` if the library routine that
@@ -104,17 +112,25 @@ Here is an explanation of implicit calls to library routines.
 
 .. function:: bool TARGET_LIBC_HAS_FUNCTION (enum function_class fn_class, tree type)
 
+  .. hook-start:TARGET_LIBC_HAS_FUNCTION
+
   This hook determines whether a function from a class of functions
   :samp:`{fn_class}` is present in the target C library.  If :samp:`{type}` is NULL,
   the caller asks for support for all standard (float, double, long double)
   types.  If :samp:`{type}` is non-NULL, the caller asks for support for a
   specific type.
 
+.. hook-end
+
 .. function:: bool TARGET_LIBC_HAS_FAST_FUNCTION (int fcode)
 
+  .. hook-start:TARGET_LIBC_HAS_FAST_FUNCTION
+
   This hook determines whether a function from a class of functions
    ``(enum function_class)``:samp:`{fcode}` has a fast implementation.
 
+.. hook-end
+
 .. c:macro:: NEXT_OBJC_RUNTIME
 
   Set this macro to 1 to use the "NeXT" Objective-C message sending conventions
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/layout-of-source-language-data-types.rst b/gcc/doc/gccint/target-description-macros-and-functions/layout-of-source-language-data-types.rst
index df6d391c687..abf96eae334 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/layout-of-source-language-data-types.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/layout-of-source-language-data-types.rst
@@ -148,6 +148,8 @@ languages, rather than to fundamental aspects of storage layout.
 
 .. function:: bool TARGET_DEFAULT_SHORT_ENUMS (void)
 
+  .. hook-start:TARGET_DEFAULT_SHORT_ENUMS
+
   This target hook should return true if the compiler should give an
   ``enum`` type only as many bytes as it takes to represent the range
   of possible values of that type.  It should return false if all
@@ -155,6 +157,8 @@ languages, rather than to fundamental aspects of storage layout.
 
   The default is to return false.
 
+.. hook-end
+
 .. c:macro:: SIZE_TYPE
 
   A C expression for a string describing the name of the data type to use
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/miscellaneous-parameters.rst b/gcc/doc/gccint/target-description-macros-and-functions/miscellaneous-parameters.rst
index f8e6c0da7d0..83c23bbe25c 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/miscellaneous-parameters.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/miscellaneous-parameters.rst
@@ -57,11 +57,15 @@ Here are several miscellaneous parameters.
 
 .. function:: unsigned int TARGET_CASE_VALUES_THRESHOLD (void)
 
+  .. hook-start:TARGET_CASE_VALUES_THRESHOLD
+
   This function return the smallest number of different values for which it
   is best to use a jump-table instead of a tree of conditional branches.
   The default is four for machines with a ``casesi`` instruction and
   five otherwise.  This is best for most machines.
 
+.. hook-end
+
 .. c:macro:: WORD_REGISTER_OPERATIONS
 
   Define this macro to 1 if operations between registers with integral mode
@@ -74,6 +78,8 @@ Here are several miscellaneous parameters.
 
 .. function:: unsigned int TARGET_MIN_ARITHMETIC_PRECISION (void)
 
+  .. hook-start:TARGET_MIN_ARITHMETIC_PRECISION
+
   On some RISC architectures with 64-bit registers, the processor also
   maintains 32-bit condition codes that make it possible to do real 32-bit
   arithmetic, although the operations are performed on the full registers.
@@ -89,6 +95,8 @@ Here are several miscellaneous parameters.
   You need not define this hook if ``WORD_REGISTER_OPERATIONS`` is not
   defined to 1.
 
+.. hook-end
+
 .. c:macro:: LOAD_EXTEND_OP (mem_mode)
 
   Define this macro to be a C expression indicating when insns that read
@@ -123,6 +131,8 @@ Here are several miscellaneous parameters.
 
 .. function:: unsigned int TARGET_MIN_DIVISIONS_FOR_RECIP_MUL (machine_mode mode)
 
+  .. hook-start:TARGET_MIN_DIVISIONS_FOR_RECIP_MUL
+
   When :option:`-ffast-math` is in effect, GCC tries to optimize
   divisions by the same divisor, by turning them into multiplications by
   the reciprocal.  This target hook specifies the minimum number of divisions
@@ -130,6 +140,8 @@ Here are several miscellaneous parameters.
   of mode :samp:`{mode}`.  The default implementation returns 3 if the machine
   has an instruction for the division, and 2 if it does not.
 
+.. hook-end
+
 .. c:macro:: MOVE_MAX
 
   The maximum number of bytes that a single instruction can move quickly
@@ -170,6 +182,8 @@ Here are several miscellaneous parameters.
 
 .. function:: unsigned HOST_WIDE_INT TARGET_SHIFT_TRUNCATION_MASK (machine_mode mode)
 
+  .. hook-start:TARGET_SHIFT_TRUNCATION_MASK
+
   This function describes how the standard shift patterns for :samp:`{mode}`
   deal with shifts by negative amounts or by more than the width of the mode.
   See :ref:`shift-patterns`.
@@ -192,8 +206,12 @@ Here are several miscellaneous parameters.
   nevertheless truncate the shift count, you may get better code
   by overriding it.
 
+.. hook-end
+
 .. function:: bool TARGET_TRULY_NOOP_TRUNCATION (poly_uint64 outprec, poly_uint64 inprec)
 
+  .. hook-start:TARGET_TRULY_NOOP_TRUNCATION
+
   This hook returns true if it is safe to 'convert' a value of
   :samp:`{inprec}` bits to one of :samp:`{outprec}` bits (where :samp:`{outprec}` is
   smaller than :samp:`{inprec}` ) by merely operating on it as if it had only
@@ -206,8 +224,12 @@ Here are several miscellaneous parameters.
   suboptimal code can result if this hook returns true for the corresponding
   mode sizes.  Making this hook return false in such cases may improve things.
 
+.. hook-end
+
 .. function:: int TARGET_MODE_REP_EXTENDED (scalar_int_mode mode, scalar_int_mode rep_mode)
 
+  .. hook-start:TARGET_MODE_REP_EXTENDED
+
   The representation of an integral mode can be such that the values
   are always extended to a wider integral mode.  Return
   ``SIGN_EXTEND`` if values of :samp:`{mode}` are represented in
@@ -234,8 +256,12 @@ Here are several miscellaneous parameters.
   ``TARGET_TRULY_NOOP_TRUNCATION`` should return false when truncating to
   ``mode``.
 
+.. hook-end
+
 .. function:: bool TARGET_SETJMP_PRESERVES_NONVOLATILE_REGS_P (void)
 
+  .. hook-start:TARGET_SETJMP_PRESERVES_NONVOLATILE_REGS_P
+
   On some targets, it is assumed that the compiler will spill all pseudos
     that are live across a call to ``setjmp``, while other targets treat
     ``setjmp`` calls as normal function calls.
@@ -247,6 +273,8 @@ Here are several miscellaneous parameters.
     The default implementation conservatively assumes all pseudos must be
     spilled across ``setjmp`` calls.
 
+.. hook-end
+
 .. c:macro:: STORE_FLAG_VALUE
 
   A C expression describing the value returned by a comparison operator
@@ -421,6 +449,8 @@ Here are several miscellaneous parameters.
 
 .. function:: const char * TARGET_C_PREINCLUDE (void)
 
+  .. hook-start:TARGET_C_PREINCLUDE
+
   Define this hook to return the name of a header file to be included at
   the start of all compilations, as if it had been included with
   ``#include <file>``.  If this hook returns ``NULL``, or is
@@ -432,14 +462,20 @@ Here are several miscellaneous parameters.
   predefined that describe properties of the whole implementation rather
   than just the compiler.
 
+.. hook-end
+
 .. function:: bool TARGET_CXX_IMPLICIT_EXTERN_C (const char*)
 
+  .. hook-start:TARGET_CXX_IMPLICIT_EXTERN_C
+
   Define this hook to add target-specific C++ implicit extern C functions.
   If this function returns true for the name of a file-scope function, that
   function implicitly gets extern "C" linkage rather than whatever language
   linkage the declaration would normally have.  An example of such function
   is WinMain on Win32 targets.
 
+.. hook-end
+
 .. c:macro:: SYSTEM_IMPLICIT_EXTERN_C
 
   Define this macro if the system header files do not support C++.
@@ -560,6 +596,8 @@ Here are several miscellaneous parameters.
 
 .. function:: rtx_insn * TARGET_MD_ASM_ADJUST (vec<rtx>& outputs, vec<rtx>& inputs, vec<machine_mode>& input_modes, vec<const char *>& constraints, vec<rtx>& clobbers, HARD_REG_SET& clobbered_regs)
 
+  .. hook-start:TARGET_MD_ASM_ADJUST
+
   This target hook may add :dfn:`clobbers` to :samp:`{clobbers}` and
   :samp:`{clobbered_regs}` for any hard regs the port wishes to automatically
   clobber for an asm.  The :samp:`{outputs}` and :samp:`{inputs}` may be inspected
@@ -571,6 +609,8 @@ Here are several miscellaneous parameters.
   changes to :samp:`{inputs}` must be accompanied by the corresponding changes
   to :samp:`{input_modes}`.
 
+.. hook-end
+
 .. c:macro:: MATH_LIBRARY
 
   Define this macro as a C string constant for the linker argument to link
@@ -649,6 +689,8 @@ Here are several miscellaneous parameters.
 
 .. function:: void TARGET_MACHINE_DEPENDENT_REORG (void)
 
+  .. hook-start:TARGET_MACHINE_DEPENDENT_REORG
+
   If non-null, this hook performs a target-specific pass over the
   instruction stream.  The compiler will run it at all optimization levels,
   just before the point at which it normally does delayed-branch scheduling.
@@ -661,8 +703,12 @@ Here are several miscellaneous parameters.
   You need not implement the hook if it has nothing to do.  The default
   definition is null.
 
+.. hook-end
+
 .. function:: void TARGET_INIT_BUILTINS (void)
 
+  .. hook-start:TARGET_INIT_BUILTINS
+
   Define this hook if you have any machine-specific built-in functions
   that need to be defined.  It should be a function that performs the
   necessary setup.
@@ -679,8 +725,12 @@ Here are several miscellaneous parameters.
   only language front ends that use those two functions will call
   :samp:`TARGET_INIT_BUILTINS`.
 
+.. hook-end
+
 .. function:: tree TARGET_BUILTIN_DECL (unsigned code, bool initialize_p)
 
+  .. hook-start:TARGET_BUILTIN_DECL
+
   Define this hook if you have any machine-specific built-in functions
   that need to be defined.  It should be a function that returns the
   builtin function declaration for the builtin function code :samp:`{code}`.
@@ -689,8 +739,12 @@ Here are several miscellaneous parameters.
   If :samp:`{code}` is out of range the function should return
   ``error_mark_node``.
 
+.. hook-end
+
 .. function:: rtx TARGET_EXPAND_BUILTIN (tree exp, rtx target, rtx subtarget, machine_mode mode, int ignore)
 
+  .. hook-start:TARGET_EXPAND_BUILTIN
+
   Expand a call to a machine specific built-in function that was set up by
   :samp:`TARGET_INIT_BUILTINS`.  :samp:`{exp}` is the expression for the
   function call; the result should go to :samp:`{target}` if that is
@@ -700,8 +754,12 @@ Here are several miscellaneous parameters.
   ignored.  This function should return the result of the call to the
   built-in function.
 
+.. hook-end
+
 .. function:: tree TARGET_RESOLVE_OVERLOADED_BUILTIN (unsigned int loc, tree fndecl, void *arglist)
 
+  .. hook-start:TARGET_RESOLVE_OVERLOADED_BUILTIN
+
   Select a replacement for a machine specific built-in function that
   was set up by :samp:`TARGET_INIT_BUILTINS`.  This is done
   *before* regular type checking, and so allows the target to
@@ -712,8 +770,12 @@ Here are several miscellaneous parameters.
   another ``CALL_EXPR``.
   :samp:`{arglist}` really has type :samp:`VEC(tree,gc)*`
 
+.. hook-end
+
 .. function:: bool TARGET_CHECK_BUILTIN_CALL (location_t loc, vec<location_t> arg_loc, tree fndecl, tree orig_fndecl, unsigned int nargs, tree *args)
 
+  .. hook-start:TARGET_CHECK_BUILTIN_CALL
+
   Perform semantic checking on a call to a machine-specific built-in
   function after its arguments have been constrained to the function
   signature.  Return true if the call is valid, otherwise report an error
@@ -727,8 +789,12 @@ Here are several miscellaneous parameters.
   of which there are :samp:`{nargs}`.  :samp:`{arg_loc}` specifies the location
   of each argument.
 
+.. hook-end
+
 .. function:: tree TARGET_FOLD_BUILTIN (tree fndecl, int n_args, tree *argp, bool ignore)
 
+  .. hook-start:TARGET_FOLD_BUILTIN
+
   Fold a call to a machine specific built-in function that was set up by
   :samp:`TARGET_INIT_BUILTINS`.  :samp:`{fndecl}` is the declaration of the
   built-in function.  :samp:`{n_args}` is the number of arguments passed to
@@ -737,15 +803,23 @@ Here are several miscellaneous parameters.
   containing a simplified expression for the call's result.  If
   :samp:`{ignore}` is true the value will be ignored.
 
+.. hook-end
+
 .. function:: bool TARGET_GIMPLE_FOLD_BUILTIN (gimple_stmt_iterator *gsi)
 
+  .. hook-start:TARGET_GIMPLE_FOLD_BUILTIN
+
   Fold a call to a machine specific built-in function that was set up
   by :samp:`TARGET_INIT_BUILTINS`.  :samp:`{gsi}` points to the gimple
   statement holding the function call.  Returns true if any change
   was made to the GIMPLE stream.
 
+.. hook-end
+
 .. function:: int TARGET_COMPARE_VERSION_PRIORITY (tree decl1, tree decl2)
 
+  .. hook-start:TARGET_COMPARE_VERSION_PRIORITY
+
   This hook is used to compare the target attributes in two functions to
   determine which function's features get higher priority.  This is used
   during function multi-versioning to figure out the order in which two
@@ -753,36 +827,56 @@ Here are several miscellaneous parameters.
   is checked for dispatching earlier.  :samp:`{decl1}` and :samp:`{decl2}` are
   the two function decls that will be compared.
 
+.. hook-end
+
 .. function:: tree TARGET_GET_FUNCTION_VERSIONS_DISPATCHER (void *decl)
 
+  .. hook-start:TARGET_GET_FUNCTION_VERSIONS_DISPATCHER
+
   This hook is used to get the dispatcher function for a set of function
   versions.  The dispatcher function is called to invoke the right function
   version at run-time. :samp:`{decl}` is one version from a set of semantically
   identical versions.
 
+.. hook-end
+
 .. function:: tree TARGET_GENERATE_VERSION_DISPATCHER_BODY (void *arg)
 
+  .. hook-start:TARGET_GENERATE_VERSION_DISPATCHER_BODY
+
   This hook is used to generate the dispatcher logic to invoke the right
   function version at run-time for a given set of function versions.
   :samp:`{arg}` points to the callgraph node of the dispatcher function whose
   body must be generated.
 
+.. hook-end
+
 .. function:: bool TARGET_PREDICT_DOLOOP_P (class loop *loop)
 
+  .. hook-start:TARGET_PREDICT_DOLOOP_P
+
   Return true if we can predict it is possible to use a low-overhead loop
   for a particular loop.  The parameter :samp:`{loop}` is a pointer to the loop.
   This target hook is required only when the target supports low-overhead
   loops, and will help ivopts to make some decisions.
   The default version of this hook returns false.
 
+.. hook-end
+
 .. c:var:: bool TARGET_HAVE_COUNT_REG_DECR_P
 
+  .. hook-start:TARGET_HAVE_COUNT_REG_DECR_P
+
   Return true if the target supports hardware count register for decrement
   and branch.
   The default value is false.
 
+.. hook-end
+
 .. c:var:: int64_t TARGET_DOLOOP_COST_FOR_GENERIC
 
+  .. hook-start:TARGET_DOLOOP_COST_FOR_GENERIC
+
   One IV candidate dedicated for doloop is introduced in IVOPTs, we can
   calculate the computation cost of adopting it to any generic IV use by
   function get_computation_cost as before.  But for targets which have
@@ -793,8 +887,12 @@ Here are several miscellaneous parameters.
   this especially for generic IV uses.
   The default value is zero.
 
+.. hook-end
+
 .. c:var:: int64_t TARGET_DOLOOP_COST_FOR_ADDRESS
 
+  .. hook-start:TARGET_DOLOOP_COST_FOR_ADDRESS
+
   One IV candidate dedicated for doloop is introduced in IVOPTs, we can
   calculate the computation cost of adopting it to any address IV use by
   function get_computation_cost as before.  But for targets which have
@@ -805,8 +903,12 @@ Here are several miscellaneous parameters.
   this escpecially for address IV uses.
   The default value is zero.
 
+.. hook-end
+
 .. function:: bool TARGET_CAN_USE_DOLOOP_P (const widest_int &iterations, const widest_int &iterations_max, unsigned int loop_depth, bool entered_at_top)
 
+  .. hook-start:TARGET_CAN_USE_DOLOOP_P
+
   Return true if it is possible to use low-overhead loops ( ``doloop_end``
   and ``doloop_begin`` ) for a particular loop.  :samp:`{iterations}` gives the
   exact number of iterations, or 0 if not known.  :samp:`{iterations_max}` gives
@@ -819,8 +921,12 @@ Here are several miscellaneous parameters.
   implementation returns true.  You can use ``can_use_doloop_if_innermost``
   if the loop must be the innermost, and if there are no other restrictions.
 
+.. hook-end
+
 .. function:: const char * TARGET_INVALID_WITHIN_DOLOOP (const rtx_insn *insn)
 
+  .. hook-start:TARGET_INVALID_WITHIN_DOLOOP
+
   Take an instruction in :samp:`{insn}` and return NULL if it is valid within a
   low-overhead loop, otherwise return a string explaining why doloop
   could not be applied.
@@ -831,29 +937,45 @@ Here are several miscellaneous parameters.
   By default, the RTL loop optimizer does not use a present doloop pattern for
   loops containing function calls or branch on table instructions.
 
+.. hook-end
+
 .. function:: bool TARGET_LEGITIMATE_COMBINED_INSN (rtx_insn *insn)
 
+  .. hook-start:TARGET_LEGITIMATE_COMBINED_INSN
+
   Take an instruction in :samp:`{insn}` and return ``false`` if the instruction
   is not appropriate as a combination of two or more instructions.  The
   default is to accept all instructions.
 
+.. hook-end
+
 .. function:: bool TARGET_CAN_FOLLOW_JUMP (const rtx_insn *follower, const rtx_insn *followee)
 
+  .. hook-start:TARGET_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.
 
+.. hook-end
+
 .. function:: bool TARGET_COMMUTATIVE_P (const_rtx x, int outer_code)
 
+  .. hook-start:TARGET_COMMUTATIVE_P
+
   This target hook returns ``true`` if :samp:`{x}` is considered to be commutative.
   Usually, this is just COMMUTATIVE_P ( :samp:`{x}` ), but the HP PA doesn't consider
   PLUS to be commutative inside a MEM.  :samp:`{outer_code}` is the rtx code
   of the enclosing rtl, if known, otherwise it is UNKNOWN.
 
+.. hook-end
+
 .. function:: rtx TARGET_ALLOCATE_INITIAL_VALUE (rtx hard_reg)
 
+  .. hook-start:TARGET_ALLOCATE_INITIAL_VALUE
+
   When the initial value of a hard register has been copied in a pseudo
   register, it is often not necessary to actually allocate another register
   to this pseudo register, because the original hard register or a stack slot
@@ -873,8 +995,12 @@ Here are several miscellaneous parameters.
   The default value of this hook is ``NULL``, which disables any special
   allocation.
 
+.. hook-end
+
 .. function:: int TARGET_UNSPEC_MAY_TRAP_P (const_rtx x, unsigned flags)
 
+  .. hook-start:TARGET_UNSPEC_MAY_TRAP_P
+
   This target hook returns nonzero if :samp:`{x}`, an ``unspec`` or
   ``unspec_volatile`` operation, might cause a trap.  Targets can use
   this hook to enhance precision of analysis for ``unspec`` and
@@ -882,8 +1008,12 @@ Here are several miscellaneous parameters.
   to analyze inner elements of :samp:`{x}` in which case :samp:`{flags}` should be
   passed along.
 
+.. hook-end
+
 .. function:: void TARGET_SET_CURRENT_FUNCTION (tree decl)
 
+  .. hook-start:TARGET_SET_CURRENT_FUNCTION
+
   The compiler invokes this hook whenever it changes its current function
   context ( ``cfun`` ).  You can define this function if
   the back end needs to perform any initialization or reset actions on a
@@ -901,6 +1031,8 @@ Here are several miscellaneous parameters.
   ``cfun`` might be ``NULL`` to indicate processing at top level,
   outside of any function scope.
 
+.. hook-end
+
 .. c:macro:: TARGET_OBJECT_SUFFIX
 
   Define this macro to be a C string representing the suffix for object
@@ -924,6 +1056,8 @@ Here are several miscellaneous parameters.
 
 .. function:: bool TARGET_CANNOT_MODIFY_JUMPS_P (void)
 
+  .. hook-start:TARGET_CANNOT_MODIFY_JUMPS_P
+
   This target hook returns ``true`` past the point in which new jump
   instructions could be created.  On machines that require a register for
   every jump such as the SHmedia ISA of SH5, this point would typically be
@@ -937,14 +1071,22 @@ Here are several miscellaneous parameters.
       return (reload_completed || reload_in_progress);
     }
 
+.. hook-end
+
 .. function:: bool TARGET_HAVE_CONDITIONAL_EXECUTION (void)
 
+  .. hook-start:TARGET_HAVE_CONDITIONAL_EXECUTION
+
   This target hook returns true if the target supports conditional execution.
   This target hook is required only when the target has several different
   modes and they have different conditional execution capability, such as ARM.
 
+.. hook-end
+
 .. function:: rtx TARGET_GEN_CCMP_FIRST (rtx_insn **prep_seq, rtx_insn **gen_seq, int code, tree op0, tree op1)
 
+  .. hook-start:TARGET_GEN_CCMP_FIRST
+
   This function prepares to emit a comparison insn for the first compare in a
    sequence of conditional comparisions.  It returns an appropriate comparison
    with ``CC`` for passing to ``gen_ccmp_next`` or ``cbranch_optab``.
@@ -953,8 +1095,12 @@ Here are several miscellaneous parameters.
    compares in the conditional comparision are generated without error.
    :samp:`{code}` is the ``rtx_code`` of the compare for :samp:`{op0}` and :samp:`{op1}`.
 
+.. hook-end
+
 .. function:: rtx TARGET_GEN_CCMP_NEXT (rtx_insn **prep_seq, rtx_insn **gen_seq, rtx prev, int cmp_code, tree op0, tree op1, int bit_code)
 
+  .. hook-start:TARGET_GEN_CCMP_NEXT
+
   This function prepares to emit a conditional comparison within a sequence
    of conditional comparisons.  It returns an appropriate comparison with
    ``CC`` for passing to ``gen_ccmp_next`` or ``cbranch_optab``.
@@ -968,8 +1114,12 @@ Here are several miscellaneous parameters.
    :samp:`{code}` is the ``rtx_code`` of the compare for :samp:`{op0}` and :samp:`{op1}`.
    :samp:`{bit_code}` is ``AND`` or ``IOR``, which is the op on the compares.
 
+.. hook-end
+
 .. function:: unsigned TARGET_LOOP_UNROLL_ADJUST (unsigned nunroll, class loop *loop)
 
+  .. hook-start:TARGET_LOOP_UNROLL_ADJUST
+
   This target hook returns a new value for the number of times :samp:`{loop}`
   should be unrolled. The parameter :samp:`{nunroll}` is the number of times
   the loop is to be unrolled. The parameter :samp:`{loop}` is a pointer to
@@ -977,6 +1127,8 @@ Here are several miscellaneous parameters.
   is required only when the target has special constraints like maximum
   number of memory accesses.
 
+.. hook-end
+
 .. c:macro:: POWI_MAX_MULTS
 
   If defined, this macro is interpreted as a signed integer C expression
@@ -1048,32 +1200,50 @@ Here are several miscellaneous parameters.
 
 .. function:: const char * TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN (const_tree typelist, const_tree funcdecl, const_tree val)
 
+  .. hook-start:TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN
+
   If defined, this macro returns the diagnostic message when it is
   illegal to pass argument :samp:`{val}` to function :samp:`{funcdecl}`
   with prototype :samp:`{typelist}`.
 
+.. hook-end
+
 .. function:: const char * TARGET_INVALID_CONVERSION (const_tree fromtype, const_tree totype)
 
+  .. hook-start:TARGET_INVALID_CONVERSION
+
   If defined, this macro returns the diagnostic message when it is
   invalid to convert from :samp:`{fromtype}` to :samp:`{totype}`, or ``NULL``
   if validity should be determined by the front end.
 
+.. hook-end
+
 .. function:: const char * TARGET_INVALID_UNARY_OP (int op, const_tree type)
 
+  .. hook-start:TARGET_INVALID_UNARY_OP
+
   If defined, this macro returns the diagnostic message when it is
   invalid to apply operation :samp:`{op}` (where unary plus is denoted by
   ``CONVERT_EXPR`` ) to an operand of type :samp:`{type}`, or ``NULL``
   if validity should be determined by the front end.
 
+.. hook-end
+
 .. function:: const char * TARGET_INVALID_BINARY_OP (int op, const_tree type1, const_tree type2)
 
+  .. hook-start:TARGET_INVALID_BINARY_OP
+
   If defined, this macro returns the diagnostic message when it is
   invalid to apply operation :samp:`{op}` to operands of types :samp:`{type1}`
   and :samp:`{type2}`, or ``NULL`` if validity should be determined by
   the front end.
 
+.. hook-end
+
 .. function:: tree TARGET_PROMOTED_TYPE (const_tree type)
 
+  .. hook-start:TARGET_PROMOTED_TYPE
+
   If defined, this target hook returns the type to which values of
   :samp:`{type}` should be promoted when they appear in expressions,
   analogous to the integer promotions, or ``NULL_TREE`` to use the
@@ -1081,8 +1251,12 @@ Here are several miscellaneous parameters.
   target-specific types with special promotion rules.
   This is currently used only by the C and C++ front ends.
 
+.. hook-end
+
 .. function:: tree TARGET_CONVERT_TO_TYPE (tree type, tree expr)
 
+  .. hook-start:TARGET_CONVERT_TO_TYPE
+
   If defined, this hook returns the result of converting :samp:`{expr}` to
   :samp:`{type}`.  It should return the converted expression,
   or ``NULL_TREE`` to apply the front end's normal conversion rules.
@@ -1090,8 +1264,12 @@ Here are several miscellaneous parameters.
   conversion rules.
   This is currently used only by the C and C++ front ends.
 
+.. hook-end
+
 .. function:: bool TARGET_VERIFY_TYPE_CONTEXT (location_t loc, type_context_kind context, const_tree type, bool silent_p)
 
+  .. hook-start:TARGET_VERIFY_TYPE_CONTEXT
+
   If defined, this hook returns false if there is a target-specific reason
   why type :samp:`{type}` cannot be used in the source language context described
   by :samp:`{context}`.  When :samp:`{silent_p}` is false, the hook also reports an
@@ -1103,6 +1281,8 @@ Here are several miscellaneous parameters.
 
   The default implementation always returns true.
 
+.. hook-end
+
 .. c:macro:: OBJC_JBLEN
 
   This macro determines the size of the objective C jump buffer for the
@@ -1117,18 +1297,28 @@ Here are several miscellaneous parameters.
 
 .. function:: void TARGET_UPDATE_STACK_BOUNDARY (void)
 
+  .. hook-start:TARGET_UPDATE_STACK_BOUNDARY
+
   Define this macro to update the current function stack boundary if
   necessary.
 
+.. hook-end
+
 .. function:: rtx TARGET_GET_DRAP_RTX (void)
 
+  .. hook-start:TARGET_GET_DRAP_RTX
+
   This hook should return an rtx for Dynamic Realign Argument Pointer (DRAP) if a
   different argument pointer register is needed to access the function's
   argument list due to stack realignment.  Return ``NULL`` if no DRAP
   is needed.
 
+.. hook-end
+
 .. function:: HARD_REG_SET TARGET_ZERO_CALL_USED_REGS (HARD_REG_SET selected_regs)
 
+  .. hook-start:TARGET_ZERO_CALL_USED_REGS
+
   This target hook emits instructions to zero the subset of :samp:`{selected_regs}`
   that could conceivably contain values that are useful to an attacker.
   Return the set of registers that were actually cleared.
@@ -1139,8 +1329,12 @@ Here are several miscellaneous parameters.
   or if you believe that certain registers would never contain
   values that are useful to an attacker.
 
+.. hook-end
+
 .. function:: bool TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS (void)
 
+  .. hook-start:TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS
+
   When optimization is disabled, this hook indicates whether or not
   arguments should be allocated to stack slots.  Normally, GCC allocates
   stacks slots for arguments when not optimizing in order to make
@@ -1150,8 +1344,12 @@ Here are several miscellaneous parameters.
   to the stack.  Therefore, this hook should return true in general, but
   false for naked functions.  The default implementation always returns true.
 
+.. hook-end
+
 .. c:var:: unsigned HOST_WIDE_INT TARGET_CONST_ANCHOR
 
+  .. hook-start:TARGET_CONST_ANCHOR
+
   On some architectures it can take multiple instructions to synthesize
   a constant.  If there is another constant already in a register that
   is close enough in value then it is preferable that the new constant
@@ -1168,38 +1366,62 @@ Here are several miscellaneous parameters.
   ``TARGET_CONST_ANCHOR`` is set to :samp:`0x8000`.  The default value
   is zero, which disables this optimization.
 
+.. hook-end
+
 .. function:: unsigned HOST_WIDE_INT TARGET_ASAN_SHADOW_OFFSET (void)
 
+  .. hook-start:TARGET_ASAN_SHADOW_OFFSET
+
   Return the offset bitwise ored into shifted address to get corresponding
   Address Sanitizer shadow memory address.  NULL if Address Sanitizer is not
   supported by the target.  May return 0 if Address Sanitizer is not supported
   by a subtarget.
 
+.. hook-end
+
 .. function:: unsigned HOST_WIDE_INT TARGET_MEMMODEL_CHECK (unsigned HOST_WIDE_INT val)
 
+  .. hook-start:TARGET_MEMMODEL_CHECK
+
   Validate target specific memory model mask bits. When NULL no target specific
   memory model bits are allowed.
 
+.. hook-end
+
 .. c:var:: unsigned char TARGET_ATOMIC_TEST_AND_SET_TRUEVAL
 
+  .. hook-start:TARGET_ATOMIC_TEST_AND_SET_TRUEVAL
+
   This value should be set if the result written by
   ``atomic_test_and_set`` is not exactly 1, i.e. the
   ``bool`` ``true``.
 
+.. hook-end
+
 .. function:: bool TARGET_HAS_IFUNC_P (void)
 
+  .. hook-start:TARGET_HAS_IFUNC_P
+
   It returns true if the target supports GNU indirect functions.
   The support includes the assembler, linker and dynamic linker.
   The default value of this hook is based on target's libc.
 
+.. hook-end
+
 .. function:: unsigned int TARGET_ATOMIC_ALIGN_FOR_MODE (machine_mode mode)
 
+  .. hook-start:TARGET_ATOMIC_ALIGN_FOR_MODE
+
   If defined, this function returns an appropriate alignment in bits for an
   atomic object of machine_mode :samp:`{mode}`.  If 0 is returned then the
   default alignment for the specified mode is used.
 
+.. hook-end
+
 .. function:: void TARGET_ATOMIC_ASSIGN_EXPAND_FENV (tree *hold, tree *clear, tree *update)
 
+  .. hook-start:TARGET_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.
@@ -1216,20 +1438,30 @@ Here are several miscellaneous parameters.
   ``__atomic_feraiseexcept`` function from ``libatomic`` may be of use
   as part of the code generated in ``*update``.
 
+.. hook-end
+
 .. function:: void TARGET_RECORD_OFFLOAD_SYMBOL (tree)
 
+  .. hook-start:TARGET_RECORD_OFFLOAD_SYMBOL
+
   Used when offloaded functions are seen in the compilation unit and no named
   sections are available.  It is called once for each symbol that must be
   recorded in the offload function and variable table.
 
+.. hook-end
+
 .. function:: char * TARGET_OFFLOAD_OPTIONS (void)
 
+  .. hook-start:TARGET_OFFLOAD_OPTIONS
+
   Used when writing out the list of options into an LTO file.  It should
   translate any relevant target-specific options (such as the ABI in use)
   into one of the :option:`-foffload` options that exist as a common interface
   to express such options.  It should return a string containing these options,
   separated by spaces, which the caller will free.
 
+.. hook-end
+
 .. c:macro:: TARGET_SUPPORTS_WIDE_INT
 
   On older ports, large integers are stored in ``CONST_DOUBLE`` rtl
@@ -1271,6 +1503,8 @@ Here are several miscellaneous parameters.
 
 .. function:: bool TARGET_HAVE_SPECULATION_SAFE_VALUE (bool active)
 
+  .. hook-start:TARGET_HAVE_SPECULATION_SAFE_VALUE
+
   This hook is used to determine the level of target support for
    ``__builtin_speculation_safe_value``.  If called with an argument
    of false, it returns true if the target has been modified to support
@@ -1287,8 +1521,12 @@ Here are several miscellaneous parameters.
    simply redefine this hook to ``speculation_safe_value_not_needed``
    along with your other target hooks.
 
+.. hook-end
+
 .. function:: rtx TARGET_SPECULATION_SAFE_VALUE (machine_mode mode, rtx result, rtx val, rtx failval)
 
+  .. hook-start:TARGET_SPECULATION_SAFE_VALUE
+
   This target hook can be used to generate a target-specific code
    sequence that implements the ``__builtin_speculation_safe_value``
    built-in function.  The function must always return :samp:`{val}` in
@@ -1305,12 +1543,20 @@ Here are several miscellaneous parameters.
   The default implementation simply copies :samp:`{val}` to :samp:`{result}` and
    emits a ``speculation_barrier`` instruction if that is defined.
 
+.. hook-end
+
 .. function:: void TARGET_RUN_TARGET_SELFTESTS (void)
 
+  .. hook-start:TARGET_RUN_TARGET_SELFTESTS
+
   If selftests are enabled, run any selftests for this target.
 
+.. hook-end
+
 .. function:: bool TARGET_MEMTAG_CAN_TAG_ADDRESSES ()
 
+  .. hook-start:TARGET_MEMTAG_CAN_TAG_ADDRESSES
+
   True if the backend architecture naturally supports ignoring some region
   of pointers.  This feature means that :option:`-fsanitize`:samp:`=hwaddress` can
   work.
@@ -1318,14 +1564,22 @@ Here are several miscellaneous parameters.
   At preset, this feature does not support address spaces.  It also requires
   ``Pmode`` to be the same as ``ptr_mode``.
 
+.. hook-end
+
 .. function:: uint8_t TARGET_MEMTAG_TAG_SIZE ()
 
+  .. hook-start:TARGET_MEMTAG_TAG_SIZE
+
   Return the size of a tag (in bits) for this platform.
 
   The default returns 8.
 
+.. hook-end
+
 .. function:: uint8_t TARGET_MEMTAG_GRANULE_SIZE ()
 
+  .. hook-start:TARGET_MEMTAG_GRANULE_SIZE
+
   Return the size in real memory that each byte in shadow memory refers to.
   I.e. if a variable is :samp:`{X}` bytes long in memory, then this hook should
   return the value :samp:`{Y}` such that the tag in shadow memory spans
@@ -1337,15 +1591,23 @@ Here are several miscellaneous parameters.
 
   The default returns 16.
 
+.. hook-end
+
 .. function:: rtx TARGET_MEMTAG_INSERT_RANDOM_TAG (rtx untagged, rtx target)
 
+  .. hook-start:TARGET_MEMTAG_INSERT_RANDOM_TAG
+
   Return an RTX representing the value of :samp:`{untagged}` but with a
   (possibly) random tag in it.
   Put that value into :samp:`{target}` if it is convenient to do so.
   This function is used to generate a tagged base for the current stack frame.
 
+.. hook-end
+
 .. function:: rtx TARGET_MEMTAG_ADD_TAG (rtx base, poly_int64 addr_offset, uint8_t tag_offset)
 
+  .. hook-start:TARGET_MEMTAG_ADD_TAG
+
   Return an RTX that represents the result of adding :samp:`{addr_offset}` to
   the address in pointer :samp:`{base}` and :samp:`{tag_offset}` to the tag in pointer
   :samp:`{base}`.
@@ -1355,22 +1617,42 @@ Here are several miscellaneous parameters.
   Unlike other memtag hooks, this must return an expression and not emit any
   RTL.
 
+.. hook-end
+
 .. function:: rtx TARGET_MEMTAG_SET_TAG (rtx untagged_base, rtx tag, rtx target)
 
+  .. hook-start:TARGET_MEMTAG_SET_TAG
+
   Return an RTX representing :samp:`{untagged_base}` but with the tag :samp:`{tag}`.
   Try and store this in :samp:`{target}` if convenient.
   :samp:`{untagged_base}` is required to have a zero tag when this hook is called.
   The default of this hook is to set the top byte of :samp:`{untagged_base}` to
   :samp:`{tag}`.
 
+.. hook-end
+
 .. function:: rtx TARGET_MEMTAG_EXTRACT_TAG (rtx tagged_pointer, rtx target)
 
+  .. hook-start:TARGET_MEMTAG_EXTRACT_TAG
+
   Return an RTX representing the tag stored in :samp:`{tagged_pointer}`.
   Store the result in :samp:`{target}` if it is convenient.
   The default represents the top byte of the original pointer.
 
+.. hook-end
+
 .. function:: rtx TARGET_MEMTAG_UNTAGGED_POINTER (rtx tagged_pointer, rtx target)
 
+  .. hook-start:TARGET_MEMTAG_UNTAGGED_POINTER
+
   Return an RTX representing :samp:`{tagged_pointer}` with its tag set to zero.
   Store the result in :samp:`{target}` if convenient.
-  The default clears the top byte of the original pointer.
\ No newline at end of file
+  The default clears the top byte of the original pointer.
+
+.. hook-end
+
+.. Copyright (C) 1988-2021 Free Software Foundation, Inc.
+
+.. This is part of the GCC manual.
+
+.. For copying conditions, see the file gccint.texi.
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/mode-switching-instructions.rst b/gcc/doc/gccint/target-description-macros-and-functions/mode-switching-instructions.rst
index 8446ad46965..5ed4dd94078 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/mode-switching-instructions.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/mode-switching-instructions.rst
@@ -49,49 +49,73 @@ The following macros control mode switching optimizations:
 
 .. function:: void TARGET_MODE_EMIT (int entity, int mode, int prev_mode, HARD_REG_SET regs_live)
 
+  .. hook-start:TARGET_MODE_EMIT
+
   Generate one or more insns to set :samp:`{entity}` to :samp:`{mode}`.
   :samp:`{hard_reg_live}` is the set of hard registers live at the point where
   the insn(s) are to be inserted. :samp:`{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.
 
+.. hook-end
+
 .. function:: int TARGET_MODE_NEEDED (int entity, rtx_insn *insn)
 
+  .. hook-start:TARGET_MODE_NEEDED
+
   :samp:`{entity}` is an integer specifying a mode-switched entity.
   If ``OPTIMIZE_MODE_SWITCHING`` is defined, you must define this macro
   to return an integer value not larger than the corresponding element
   in ``NUM_MODES_FOR_MODE_SWITCHING``, to denote the mode that :samp:`{entity}`
   must be switched into prior to the execution of :samp:`{insn}`.
 
+.. hook-end
+
 .. function:: int TARGET_MODE_AFTER (int entity, int mode, rtx_insn *insn)
 
+  .. hook-start:TARGET_MODE_AFTER
+
   :samp:`{entity}` is an integer specifying a mode-switched entity.
   If this macro is defined, it is evaluated for every :samp:`{insn}` during mode
   switching.  It determines the mode that an insn results
   in (if different from the incoming mode).
 
+.. hook-end
+
 .. function:: int TARGET_MODE_ENTRY (int entity)
 
+  .. hook-start:TARGET_MODE_ENTRY
+
   If this macro is defined, it is evaluated for every :samp:`{entity}` that
   needs mode switching.  It should evaluate to an integer, which is a mode
   that :samp:`{entity}` is assumed to be switched to at function entry.
   If ``TARGET_MODE_ENTRY`` is defined then ``TARGET_MODE_EXIT``
   must be defined.
 
+.. hook-end
+
 .. function:: int TARGET_MODE_EXIT (int entity)
 
+  .. hook-start:TARGET_MODE_EXIT
+
   If this macro is defined, it is evaluated for every :samp:`{entity}` that
   needs mode switching.  It should evaluate to an integer, which is a mode
   that :samp:`{entity}` is assumed to be switched to at function exit.
   If ``TARGET_MODE_EXIT`` is defined then ``TARGET_MODE_ENTRY``
   must be defined.
 
+.. hook-end
+
 .. function:: int TARGET_MODE_PRIORITY (int entity, int n)
 
+  .. hook-start:TARGET_MODE_PRIORITY
+
   This macro specifies the order in which modes for :samp:`{entity}`
   are processed. 0 is the highest priority,
   ``NUM_MODES_FOR_MODE_SWITCHING[entity] - 1`` the lowest.
   The value of the macro should be an integer designating a mode
   for :samp:`{entity}`.  For any fixed :samp:`{entity}`, ``mode_priority``
   ( :samp:`{entity}`, :samp:`{n}` ) shall be a bijection in 0 ...
-  ``num_modes_for_mode_switching[entity] - 1``.
\ No newline at end of file
+  ``num_modes_for_mode_switching[entity] - 1``.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/parameters-for-precompiled-header-validity-checking.rst b/gcc/doc/gccint/target-description-macros-and-functions/parameters-for-precompiled-header-validity-checking.rst
index 4625719ca0f..16374322369 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/parameters-for-precompiled-header-validity-checking.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/parameters-for-precompiled-header-validity-checking.rst
@@ -12,12 +12,18 @@ Parameters for Precompiled Header Validity Checking
 
 .. function:: void * TARGET_GET_PCH_VALIDITY (size_t *sz)
 
+  .. hook-start:TARGET_GET_PCH_VALIDITY
+
   This hook returns a pointer to the data needed by
   ``TARGET_PCH_VALID_P`` and sets
   :samp:`*{sz}` to the size of the data in bytes.
 
+.. hook-end
+
 .. function:: const char * TARGET_PCH_VALID_P (const void *data, size_t sz)
 
+  .. hook-start:TARGET_PCH_VALID_P
+
   This hook checks whether the options used to create a PCH file are
   compatible with the current settings.  It returns ``NULL``
   if so and a suitable error message if not.  Error messages will
@@ -31,17 +37,27 @@ Parameters for Precompiled Header Validity Checking
   The default definition of ``default_pch_valid_p`` should be
   suitable for most targets.
 
+.. hook-end
+
 .. function:: const char * TARGET_CHECK_PCH_TARGET_FLAGS (int pch_flags)
 
+  .. hook-start:TARGET_CHECK_PCH_TARGET_FLAGS
+
   If this hook is nonnull, the default implementation of
   ``TARGET_PCH_VALID_P`` will use it to check for compatible values
   of ``target_flags``.  :samp:`{pch_flags}` specifies the value that
   ``target_flags`` had when the PCH file was created.  The return
   value is the same as for ``TARGET_PCH_VALID_P``.
 
+.. hook-end
+
 .. function:: void TARGET_PREPARE_PCH_SAVE (void)
 
+  .. hook-start:TARGET_PREPARE_PCH_SAVE
+
   Called before writing out a PCH file.  If the target has some
   garbage-collected data that needs to be in a particular state on PCH loads,
   it can use this hook to enforce that state.  Very few targets need
-  to do anything here.
\ No newline at end of file
+  to do anything here.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/register-classes.rst b/gcc/doc/gccint/target-description-macros-and-functions/register-classes.rst
index a4527175d39..53d61a44583 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/register-classes.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/register-classes.rst
@@ -227,6 +227,8 @@ in many of the tables described below.
 
 .. function:: reg_class_t TARGET_PREFERRED_RENAME_CLASS (reg_class_t rclass)
 
+  .. hook-start:TARGET_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
   :samp:`{rclass}` to another class, or perhaps :samp:`{NO_REGS}`, if no
@@ -238,8 +240,12 @@ in many of the tables described below.
   ``LO_REGS`` from ``preferred_rename_class``, code size can
   be reduced.
 
+.. hook-end
+
 .. function:: reg_class_t TARGET_PREFERRED_RELOAD_CLASS (rtx x, reg_class_t rclass)
 
+  .. hook-start:TARGET_PREFERRED_RELOAD_CLASS
+
   A target hook that places additional restrictions on the register class
   to use when it is necessary to copy value :samp:`{x}` into a register in class
   :samp:`{rclass}`.  The value is a register class; perhaps :samp:`{rclass}`, or perhaps
@@ -272,6 +278,8 @@ in many of the tables described below.
   this feature to discourage usage of 387 registers when math is done in
   the SSE registers (and vice versa).
 
+.. hook-end
+
 .. c:macro:: PREFERRED_RELOAD_CLASS (x, class)
 
   A C expression that places additional restrictions on the register class
@@ -311,6 +319,8 @@ in many of the tables described below.
 
 .. function:: reg_class_t TARGET_PREFERRED_OUTPUT_RELOAD_CLASS (rtx x, reg_class_t rclass)
 
+  .. hook-start:TARGET_PREFERRED_OUTPUT_RELOAD_CLASS
+
   Like ``TARGET_PREFERRED_RELOAD_CLASS``, but for output reloads instead of
   input reloads.
 
@@ -320,6 +330,8 @@ in many of the tables described below.
   You can also use ``TARGET_PREFERRED_OUTPUT_RELOAD_CLASS`` to discourage
   reload from using some alternatives, like ``TARGET_PREFERRED_RELOAD_CLASS``.
 
+.. hook-end
+
 .. c:macro:: LIMIT_RELOAD_CLASS (mode, class)
 
   A C expression that places additional restrictions on the register class
@@ -338,6 +350,8 @@ in many of the tables described below.
 
 .. function:: reg_class_t TARGET_SECONDARY_RELOAD (bool in_p, rtx x, reg_class_t reload_class, machine_mode reload_mode, secondary_reload_info *sri)
 
+  .. hook-start:TARGET_SECONDARY_RELOAD
+
   Many machines have some registers that cannot be copied directly to or
   from memory or even from other types of registers.  An example is the
   :samp:`MQ` register, which on most machines, can only be copied to or
@@ -399,13 +413,20 @@ in many of the tables described below.
   have code to handle the register class of the intermediate operand.
 
   .. [For later: maybe we'll allow multi-alternative reload patterns -
-       the port maintainer could name a mov<mode> pattern that has clobbers -
-       and match the constraints of input and output to determine the required
-       alternative.  A restriction would be that constraints used to match
-       against reloads registers would have to be written as register class
-       constraints, or we need a new target macro / hook that tells us if an
-       arbitrary constraint can match an unknown register of a given class.
-       Such a macro / hook would also be useful in other places.]
+
+  ..   the port maintainer could name a mov<mode> pattern that has clobbers -
+
+  ..   and match the constraints of input and output to determine the required
+
+  ..   alternative.  A restriction would be that constraints used to match
+
+  ..   against reloads registers would have to be written as register class
+
+  ..   constraints, or we need a new target macro / hook that tells us if an
+
+  ..   arbitrary constraint can match an unknown register of a given class.
+
+  ..   Such a macro / hook would also be useful in other places.]
 
   :samp:`{x}` might be a pseudo-register or a ``subreg`` of a
   pseudo-register, which could either be in a hard register or in memory.
@@ -423,6 +444,8 @@ in many of the tables described below.
   of the individual moves due to expected fortuitous scheduling and/or special
   forwarding logic, you can set ``sri->extra_cost`` to a negative amount.
 
+.. hook-end
+
 .. c:macro:: SECONDARY_RELOAD_CLASS (class, mode, x)
 
 .. c:macro:: SECONDARY_INPUT_RELOAD_CLASS (class, mode, x)
@@ -487,6 +510,8 @@ in many of the tables described below.
 
 .. function:: bool TARGET_SECONDARY_MEMORY_NEEDED (machine_mode mode, reg_class_t class1, reg_class_t class2)
 
+  .. hook-start:TARGET_SECONDARY_MEMORY_NEEDED
+
   Certain machines have the property that some registers cannot be copied
   to some other registers without using memory.  Define this hook on
   those machines to return true if objects of mode :samp:`{m}` in registers
@@ -495,6 +520,8 @@ in many of the tables described below.
   location into a register of :samp:`{class2}`.  The default definition returns
   false for all inputs.
 
+.. hook-end
+
 .. c:macro:: SECONDARY_MEMORY_NEEDED_RTX (mode)
 
   Normally when ``TARGET_SECONDARY_MEMORY_NEEDED`` is defined, the compiler
@@ -507,6 +534,8 @@ in many of the tables described below.
 
 .. function:: machine_mode TARGET_SECONDARY_MEMORY_NEEDED_MODE (machine_mode mode)
 
+  .. hook-start:TARGET_SECONDARY_MEMORY_NEEDED_MODE
+
   If ``TARGET_SECONDARY_MEMORY_NEEDED`` tells the compiler to use memory
   when moving between two particular registers of mode :samp:`{mode}`,
   this hook specifies the mode that the memory should have.
@@ -527,8 +556,12 @@ in many of the tables described below.
 
   With LRA, the default is to use :samp:`{mode}` unmodified.
 
+.. hook-end
+
 .. function:: void TARGET_SELECT_EARLY_REMAT_MODES (sbitmap modes)
 
+  .. hook-start:TARGET_SELECT_EARLY_REMAT_MODES
+
   On some targets, certain modes cannot be held in registers around a
   standard ABI call and are relatively expensive to spill to the stack.
   The early rematerialization pass can help in such cases by aggressively
@@ -538,8 +571,12 @@ in many of the tables described below.
   in :samp:`{modes}`.  The default implementation selects no modes, which has
   the effect of disabling the early rematerialization pass.
 
+.. hook-end
+
 .. function:: bool TARGET_CLASS_LIKELY_SPILLED_P (reg_class_t rclass)
 
+  .. hook-start:TARGET_CLASS_LIKELY_SPILLED_P
+
   A target hook which returns ``true`` if pseudos that have been assigned
   to registers of class :samp:`{rclass}` would likely be spilled because
   registers of :samp:`{rclass}` are needed for spill registers.
@@ -554,8 +591,12 @@ in many of the tables described below.
   transformations to throtle code motion, to avoid increasing register
   pressure.
 
+.. hook-end
+
 .. function:: unsigned char TARGET_CLASS_MAX_NREGS (reg_class_t rclass, machine_mode mode)
 
+  .. hook-start:TARGET_CLASS_MAX_NREGS
+
   A target hook returns the maximum number of consecutive registers
   of class :samp:`{rclass}` needed to hold a value of mode :samp:`{mode}`.
 
@@ -571,6 +612,8 @@ in many of the tables described below.
   The default version of this target hook returns the size of :samp:`{mode}`
   in words.
 
+.. hook-end
+
 .. c:macro:: CLASS_MAX_NREGS (class, mode)
 
   A C expression for the maximum number of consecutive registers
@@ -586,6 +629,8 @@ in many of the tables described below.
 
 .. function:: bool TARGET_CAN_CHANGE_MODE_CLASS (machine_mode from, machine_mode to, reg_class_t rclass)
 
+  .. hook-start:TARGET_CAN_CHANGE_MODE_CLASS
+
   This hook returns true if it is possible to bitcast values held in
   registers of class :samp:`{rclass}` from mode :samp:`{from}` to mode :samp:`{to}`
   and if doing so preserves the low-order bits that are common to both modes.
@@ -614,22 +659,34 @@ in many of the tables described below.
   entire ``raw_reg_mode`` being modified instead of the partial
   value that the middle-end intended.
 
+.. hook-end
+
 .. function:: reg_class_t TARGET_IRA_CHANGE_PSEUDO_ALLOCNO_CLASS (int, reg_class_t, reg_class_t)
 
+  .. hook-start:TARGET_IRA_CHANGE_PSEUDO_ALLOCNO_CLASS
+
   A target hook which can change allocno class for given pseudo from
     allocno and best class calculated by IRA.
 
   The default version of this target hook always returns given class.
 
+.. hook-end
+
 .. function:: bool TARGET_LRA_P (void)
 
+  .. hook-start:TARGET_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.
 
+.. hook-end
+
 .. function:: int TARGET_REGISTER_PRIORITY (int)
 
+  .. hook-start:TARGET_REGISTER_PRIORITY
+
   A target hook which returns the register priority number to which the
   register :samp:`{hard_regno}` belongs to.  The bigger the number, the
   more preferable the hard register usage (when all other conditions are
@@ -641,8 +698,12 @@ in many of the tables described below.
 
   The default version of this target hook returns always zero.
 
+.. hook-end
+
 .. function:: bool TARGET_REGISTER_USAGE_LEVELING_P (void)
 
+  .. hook-start:TARGET_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
@@ -653,8 +714,12 @@ in many of the tables described below.
 
   The default version of this target hook returns always false.
 
+.. hook-end
+
 .. function:: bool TARGET_DIFFERENT_ADDR_DISPLACEMENT_P (void)
 
+  .. hook-start:TARGET_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
@@ -662,8 +727,12 @@ in many of the tables described below.
 
   The default version of this target hook returns always false.
 
+.. hook-end
+
 .. function:: bool TARGET_CANNOT_SUBSTITUTE_MEM_EQUIV_P (rtx subst)
 
+  .. hook-start:TARGET_CANNOT_SUBSTITUTE_MEM_EQUIV_P
+
   A target hook which returns ``true`` if :samp:`{subst}` can't
   substitute safely pseudos with equivalent memory values during
   register allocation.
@@ -672,8 +741,12 @@ in many of the tables described below.
   machines with non orthogonal register usage for addressing, such
   as SH, this hook can be used to avoid excessive spilling.
 
+.. hook-end
+
 .. function:: bool TARGET_LEGITIMIZE_ADDRESS_DISPLACEMENT (rtx *offset1, rtx *offset2, poly_int64 orig_offset, machine_mode mode)
 
+  .. hook-start:TARGET_LEGITIMIZE_ADDRESS_DISPLACEMENT
+
   This hook tries to split address offset :samp:`{orig_offset}` into
   two parts: one that should be added to the base address to create
   a local anchor point, and an additional offset that can be applied
@@ -684,15 +757,23 @@ in many of the tables described below.
   anchor from the base in :samp:`{offset1}` and the offset of the final address
   from the anchor in :samp:`{offset2}`.  The default implementation returns false.
 
+.. hook-end
+
 .. function:: reg_class_t TARGET_SPILL_CLASS (reg_class_t, machine_mode)
 
+  .. hook-start:TARGET_SPILL_CLASS
+
   This hook defines a class of registers which could be used for spilling
   pseudos of the given mode and class, or ``NO_REGS`` if only memory
   should be used.  Not defining this hook is equivalent to returning
   ``NO_REGS`` for all inputs.
 
+.. hook-end
+
 .. function:: bool TARGET_ADDITIONAL_ALLOCNO_CLASS_P (reg_class_t)
 
+  .. hook-start:TARGET_ADDITIONAL_ALLOCNO_CLASS_P
+
   This hook should return ``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
@@ -700,17 +781,27 @@ in many of the tables described below.
   allocno ones for RA correct work.  Not defining this hook is
   equivalent to returning ``false`` for all inputs.
 
+.. hook-end
+
 .. function:: scalar_int_mode TARGET_CSTORE_MODE (enum insn_code icode)
 
+  .. hook-start:TARGET_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.
 
+.. hook-end
+
 .. function:: int TARGET_COMPUTE_PRESSURE_CLASSES (enum reg_class *pressure_classes)
 
+  .. hook-start:TARGET_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 :samp:`{pressure_classes}`.
\ No newline at end of file
+  register classes stored in the array :samp:`{pressure_classes}`.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/register-usage.rst b/gcc/doc/gccint/target-description-macros-and-functions/register-usage.rst
index 7c2d2048148..79bbfad6f96 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/register-usage.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/register-usage.rst
@@ -105,13 +105,19 @@ Registers have various characteristics.
 
 .. function:: const predefined_function_abi & TARGET_FNTYPE_ABI (const_tree type)
 
+  .. hook-start:TARGET_FNTYPE_ABI
+
   Return the ABI used by a function with type :samp:`{type}` ; see the
   definition of ``predefined_function_abi`` for details of the ABI
   descriptor.  Targets only need to define this hook if they support
   interoperability between several ABIs in the same translation unit.
 
+.. hook-end
+
 .. function:: const predefined_function_abi & TARGET_INSN_CALLEE_ABI (const rtx_insn *insn)
 
+  .. hook-start:TARGET_INSN_CALLEE_ABI
+
   This hook returns a description of the ABI used by the target of
   call instruction :samp:`{insn}` ; see the definition of
   ``predefined_function_abi`` for details of the ABI descriptor.
@@ -121,6 +127,8 @@ Registers have various characteristics.
   Targets only need to define this hook if they support
   interoperability between several ABIs in the same translation unit.
 
+.. hook-end
+
 .. index:: call-used register
 
 .. index:: call-clobbered register
@@ -129,6 +137,8 @@ Registers have various characteristics.
 
 .. function:: bool TARGET_HARD_REGNO_CALL_PART_CLOBBERED (unsigned int abi_id, unsigned int regno, machine_mode mode)
 
+  .. hook-start:TARGET_HARD_REGNO_CALL_PART_CLOBBERED
+
   ABIs usually specify that calls must preserve the full contents
   of a particular register, or that calls can alter any part of a
   particular register.  This information is captured by the target macro
@@ -149,10 +159,16 @@ Registers have various characteristics.
   The default implementation returns false, which is correct
   for targets that don't have partly call-clobbered registers.
 
+.. hook-end
+
 .. function:: const char * TARGET_GET_MULTILIB_ABI_NAME (void)
 
+  .. hook-start:TARGET_GET_MULTILIB_ABI_NAME
+
   This hook returns name of multilib ABI name.
 
+.. hook-end
+
 .. index:: fixed_regs
 
 .. index:: call_used_regs
@@ -165,6 +181,8 @@ Registers have various characteristics.
 
 .. function:: void TARGET_CONDITIONAL_REGISTER_USAGE (void)
 
+  .. hook-start:TARGET_CONDITIONAL_REGISTER_USAGE
+
   This hook may conditionally modify five variables
   ``fixed_regs``, ``call_used_regs``, ``global_regs``,
   ``reg_names``, and ``reg_class_contents``, to take into account
@@ -196,6 +214,8 @@ Registers have various characteristics.
   controlled by target switches, then GCC will automatically avoid using
   these registers when the target switches are opposed to them.)
 
+.. hook-end
+
 .. c:macro:: INCOMING_REGNO (out)
 
   Define this macro if the target machine has register windows.  This C
@@ -299,6 +319,8 @@ consecutive registers are needed for a given mode.
 
 .. function:: unsigned int TARGET_HARD_REGNO_NREGS (unsigned int regno, machine_mode mode)
 
+  .. hook-start:TARGET_HARD_REGNO_NREGS
+
   This hook returns the number of consecutive hard registers, starting
   at register number :samp:`{regno}`, required to hold a value of mode
   :samp:`{mode}`.  This hook must never return zero, even if a register
@@ -308,6 +330,8 @@ consecutive registers are needed for a given mode.
 
   The default definition returns the number of words in :samp:`{mode}`.
 
+.. hook-end
+
 .. c:macro:: HARD_REGNO_NREGS_HAS_PADDING (regno, mode)
 
   A C expression that is nonzero if a value of mode :samp:`{mode}`, stored
@@ -346,6 +370,8 @@ consecutive registers are needed for a given mode.
 
 .. function:: bool TARGET_HARD_REGNO_MODE_OK (unsigned int regno, machine_mode mode)
 
+  .. hook-start:TARGET_HARD_REGNO_MODE_OK
+
   This hook returns true if it is permissible to store a value
   of mode :samp:`{mode}` in hard register number :samp:`{regno}` (or in several
   registers starting with that one).  The default definition returns true
@@ -402,6 +428,8 @@ consecutive registers are needed for a given mode.
   floating registers are not in class ``GENERAL_REGS``, they will not
   be used unless some pattern's constraint asks for one.
 
+.. hook-end
+
 .. c:macro:: HARD_REGNO_RENAME_OK (from, to)
 
   A C expression that is nonzero if it is OK to rename a hard register
@@ -415,6 +443,8 @@ consecutive registers are needed for a given mode.
 
 .. function:: bool TARGET_MODES_TIEABLE_P (machine_mode mode1, machine_mode mode2)
 
+  .. hook-start:TARGET_MODES_TIEABLE_P
+
   This hook returns true if a value of mode :samp:`{mode1}` is accessible
   in mode :samp:`{mode2}` without copying.
 
@@ -430,8 +460,12 @@ consecutive registers are needed for a given mode.
   possible since doing so will allow GCC to perform better register
   allocation.  The default definition returns true unconditionally.
 
+.. hook-end
+
 .. function:: bool TARGET_HARD_REGNO_SCRATCH_OK (unsigned int regno)
 
+  .. hook-start:TARGET_HARD_REGNO_SCRATCH_OK
+
   This target hook should return ``true`` if it is OK to use a hard register
   :samp:`{regno}` as scratch reg in peephole2.
 
@@ -440,6 +474,8 @@ consecutive registers are needed for a given mode.
 
   The default version of this hook always returns ``true``.
 
+.. hook-end
+
 .. c:macro:: AVOID_CCMODE_COPIES
 
   Define this macro if the compiler should avoid copies to/from ``CCmode``
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/run-time-target-specification.rst b/gcc/doc/gccint/target-description-macros-and-functions/run-time-target-specification.rst
index be4e042237b..5ec584dd7bf 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/run-time-target-specification.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/run-time-target-specification.rst
@@ -73,6 +73,10 @@ any target-specific headers.
 
 .. c:var:: int TARGET_DEFAULT_TARGET_FLAGS
 
+  .. hook-start:TARGET_DEFAULT_TARGET_FLAGS
+
+  .. hook-end
+
   This variable specifies the initial value of ``target_flags``.
   Its default setting is 0.
 
@@ -82,6 +86,10 @@ any target-specific headers.
 
 .. function:: bool TARGET_HANDLE_OPTION (struct gcc_options *opts, struct gcc_options *opts_set, const struct cl_decoded_option *decoded, location_t loc)
 
+  .. hook-start:TARGET_HANDLE_OPTION
+
+  .. hook-end
+
   This hook is called whenever the user specifies one of the
   target-specific options described by the :samp:`.opt` definition files
   (see :ref:`options`).  It has the opportunity to do some option-specific
@@ -96,6 +104,10 @@ any target-specific headers.
 
 .. function:: bool TARGET_HANDLE_C_OPTION (size_t code, const char *arg, int value)
 
+  .. hook-start:TARGET_HANDLE_C_OPTION
+
+  .. hook-end
+
   This target hook is called whenever the user specifies one of the
   target-specific C language family options described by the :samp:`.opt`
   definition files(see :ref:`options`).  It has the opportunity to do some
@@ -110,6 +122,8 @@ any target-specific headers.
 
 .. function:: tree TARGET_OBJC_CONSTRUCT_STRING_OBJECT (tree string)
 
+  .. hook-start:TARGET_OBJC_CONSTRUCT_STRING_OBJECT
+
   Targets may provide a string object type that can be used within
   and between C, C++ and their respective Objective-C dialects.
   A string object might, for example, embed encoding and length information.
@@ -123,30 +137,50 @@ any target-specific headers.
   At present, the hook is used by Objective-C only, to obtain a
   common-format string object when the target provides one.
 
+.. hook-end
+
 .. function:: void TARGET_OBJC_DECLARE_UNRESOLVED_CLASS_REFERENCE (const char *classname)
 
+  .. hook-start:TARGET_OBJC_DECLARE_UNRESOLVED_CLASS_REFERENCE
+
   Declare that Objective C class :samp:`{classname}` is referenced
   by the current TU.
 
+.. hook-end
+
 .. function:: void TARGET_OBJC_DECLARE_CLASS_DEFINITION (const char *classname)
 
+  .. hook-start:TARGET_OBJC_DECLARE_CLASS_DEFINITION
+
   Declare that Objective C class :samp:`{classname}` is defined
   by the current TU.
 
+.. hook-end
+
 .. function:: bool TARGET_STRING_OBJECT_REF_TYPE_P (const_tree stringref)
 
+  .. hook-start:TARGET_STRING_OBJECT_REF_TYPE_P
+
   If a target implements string objects then this hook should return
   ``true`` if :samp:`{stringref}` is a valid reference to such an object.
 
+.. hook-end
+
 .. function:: void TARGET_CHECK_STRING_OBJECT_FORMAT_ARG (tree format_arg, tree args_list)
 
+  .. hook-start:TARGET_CHECK_STRING_OBJECT_FORMAT_ARG
+
   If a target implements string objects then this hook should should
   provide a facility to check the function arguments in :samp:`{args_list}`
   against the format specifiers in :samp:`{format_arg}` where the type of
   :samp:`{format_arg}` is one recognized as a valid string reference type.
 
+.. hook-end
+
 .. function:: void TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE (void)
 
+  .. hook-start:TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE
+
   This target function is similar to the hook ``TARGET_OPTION_OVERRIDE``
   but is called when the optimize level is changed via an attribute or
   pragma or when it is reset at the end of the code affected by the
@@ -155,6 +189,8 @@ any target-specific headers.
   actions then, you should have ``TARGET_OPTION_OVERRIDE`` call
   ``TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE``.
 
+.. hook-end
+
 .. c:macro:: C_COMMON_OVERRIDE_OPTIONS
 
   This is similar to the ``TARGET_OPTION_OVERRIDE`` hook
@@ -165,6 +201,10 @@ any target-specific headers.
 
 .. c:var:: const struct default_options * TARGET_OPTION_OPTIMIZATION_TABLE
 
+  .. hook-start:TARGET_OPTION_OPTIMIZATION_TABLE
+
+  .. hook-end
+
   Some machines may desire to change what optimizations are performed for
   various optimization levels.   This variable, if defined, describes
   options to enable at particular sets of optimization levels.  These
@@ -179,8 +219,12 @@ any target-specific headers.
 
 .. function:: void TARGET_OPTION_INIT_STRUCT (struct gcc_options *opts)
 
+  .. hook-start:TARGET_OPTION_INIT_STRUCT
+
   Set target-dependent initial values of fields in :samp:`{opts}`.
 
+.. hook-end
+
 .. c:macro:: SWITCHABLE_TARGET
 
   Some targets need to switch between substantially different subtargets
@@ -202,10 +246,14 @@ any target-specific headers.
 
 .. function:: bool TARGET_FLOAT_EXCEPTIONS_ROUNDING_SUPPORTED_P (void)
 
+  .. hook-start:TARGET_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
   ``float`` and ``double`` types, but not necessarily ``long double``.
   By default, returns true if the ``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.
\ No newline at end of file
+  does not.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/basic-stack-layout.rst b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/basic-stack-layout.rst
index 8d80d34bc2c..4f03ddff3fe 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/basic-stack-layout.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/basic-stack-layout.rst
@@ -49,12 +49,16 @@ Here is the basic stack layout.
 
 .. function:: HOST_WIDE_INT TARGET_STARTING_FRAME_OFFSET (void)
 
+  .. hook-start:TARGET_STARTING_FRAME_OFFSET
+
   This hook returns the offset from the frame pointer to the first local
   variable slot to be allocated.  If ``FRAME_GROWS_DOWNWARD``, it is the
   offset to *end* of the first slot allocated, otherwise it is the
   offset to *beginning* of the first slot allocated.  The default
   implementation returns 0.
 
+.. hook-end
+
 .. c:macro:: STACK_ALIGNMENT_NEEDED
 
   Define to zero to disable final alignment of the stack during reload.
@@ -122,12 +126,16 @@ Here is the basic stack layout.
 
 .. function:: rtx TARGET_BUILTIN_SETJMP_FRAME_VALUE (void)
 
+  .. hook-start:TARGET_BUILTIN_SETJMP_FRAME_VALUE
+
   This target hook should return an rtx that is used to store
   the address of the current frame into the built in ``setjmp`` buffer.
   The default value, ``virtual_stack_vars_rtx``, is correct for most
   machines.  One reason you may need to define this target hook is if
   ``hard_frame_pointer_rtx`` is the appropriate value on your machine.
 
+.. hook-end
+
 .. c:macro:: FRAME_ADDR_RTX (frameaddr)
 
   A C expression whose value is RTL representing the value of the frame
@@ -190,6 +198,8 @@ Here is the basic stack layout.
 
 .. function:: void TARGET_DWARF_HANDLE_FRAME_UNSPEC (const char *label, rtx pattern, int index)
 
+  .. hook-start:TARGET_DWARF_HANDLE_FRAME_UNSPEC
+
   This target hook allows the backend to emit frame-related insns that
   contain UNSPECs or UNSPEC_VOLATILEs.  The DWARF 2 call frame debugging
   info engine will invoke it on insns of the form
@@ -208,8 +218,12 @@ Here is the basic stack layout.
   the CFI label attached to the insn, :samp:`{pattern}` is the pattern of
   the insn and :samp:`{index}` is ``UNSPEC_INDEX`` or ``UNSPECV_INDEX``.
 
+.. hook-end
+
 .. function:: unsigned int TARGET_DWARF_POLY_INDETERMINATE_VALUE (unsigned int i, unsigned int *factor, int *offset)
 
+  .. hook-start:TARGET_DWARF_POLY_INDETERMINATE_VALUE
+
   Express the value of ``poly_int`` indeterminate :samp:`{i}` as a DWARF
   expression, with :samp:`{i}` counting from 1.  Return the number of a DWARF
   register :samp:`{R}` and set :samp:`*{factor}` and :samp:`*{offset}` such
@@ -222,6 +236,8 @@ Here is the basic stack layout.
   A target only needs to define this hook if it sets
   :samp:`NUM_POLY_INT_COEFFS` to a value greater than 1.
 
+.. hook-end
+
 .. c:macro:: INCOMING_FRAME_SP_OFFSET
 
   A C expression whose value is an integer giving the offset, in bytes,
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/eliminating-frame-pointer-and-arg-pointer.rst b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/eliminating-frame-pointer-and-arg-pointer.rst
index fa55657a151..69caf54e33d 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/eliminating-frame-pointer-and-arg-pointer.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/eliminating-frame-pointer-and-arg-pointer.rst
@@ -14,6 +14,8 @@ This is about eliminating the frame pointer and arg pointer.
 
 .. function:: bool TARGET_FRAME_POINTER_REQUIRED (void)
 
+  .. hook-start:TARGET_FRAME_POINTER_REQUIRED
+
   This target hook should return ``true`` if a function must have and use
   a frame pointer.  This target hook is called in the reload pass.  If its return
   value is ``true`` the function will have a frame pointer.
@@ -37,6 +39,8 @@ This is about eliminating the frame pointer and arg pointer.
 
   Default return value is ``false``.
 
+.. hook-end
+
 .. c:macro:: ELIMINABLE_REGS
 
   This macro specifies a table of register pairs used to eliminate
@@ -65,6 +69,8 @@ This is about eliminating the frame pointer and arg pointer.
 
 .. function:: bool TARGET_CAN_ELIMINATE (const int from_reg, const int to_reg)
 
+  .. hook-start:TARGET_CAN_ELIMINATE
+
   This target hook should return ``true`` if the compiler is allowed to
   try to replace register number :samp:`{from_reg}` with register number
   :samp:`{to_reg}`.  This target hook will usually be ``true``, since most of the
@@ -73,6 +79,8 @@ This is about eliminating the frame pointer and arg pointer.
 
   Default return value is ``true``.
 
+.. hook-end
+
 .. c:macro:: INITIAL_ELIMINATION_OFFSET (from_reg, to_reg, offset_var)
 
   This macro returns the initial difference between the specified pair
@@ -82,9 +90,13 @@ This is about eliminating the frame pointer and arg pointer.
 
 .. function:: void TARGET_COMPUTE_FRAME_LAYOUT (void)
 
+  .. hook-start:TARGET_COMPUTE_FRAME_LAYOUT
+
   This target hook is called once each time the frame layout needs to be
   recalculated.  The calculations can be cached by the target and can then
   be used by ``INITIAL_ELIMINATION_OFFSET`` instead of re-computing the
   layout on every invocation of that hook.  This is particularly useful
   for targets that have an expensive frame layout function.  Implementing
-  this callback is optional.
\ No newline at end of file
+  this callback is optional.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/function-entry-and-exit.rst b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/function-entry-and-exit.rst
index 5675e45a85a..51be9f13da0 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/function-entry-and-exit.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/function-entry-and-exit.rst
@@ -19,6 +19,8 @@ This section describes the macros that output function entry
 
 .. function:: void TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY (FILE *file, unsigned HOST_WIDE_INT patch_area_size, bool record_p)
 
+  .. hook-start:TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY
+
   Generate a patchable area at the function start, consisting of
   :samp:`{patch_area_size}` NOP instructions.  If the target supports named
   sections and if :samp:`{record_p}` is true, insert a pointer to the current
@@ -26,8 +28,12 @@ This section describes the macros that output function entry
   of the hook places the table of pointers in the special section named
   ``__patchable_function_entries``.
 
+.. hook-end
+
 .. function:: void TARGET_ASM_FUNCTION_PROLOGUE (FILE *file)
 
+  .. hook-start:TARGET_ASM_FUNCTION_PROLOGUE
+
   If defined, a function that outputs the assembler code for entry to a
   function.  The prologue is responsible for setting up the stack frame,
   initializing the frame pointer register, saving registers that must be
@@ -73,22 +79,34 @@ This section describes the macros that output function entry
   or by a debugger, there is no reason why the stack layout used by GCC
   need agree with that used by other compilers for a machine.
 
+.. hook-end
+
 .. function:: void TARGET_ASM_FUNCTION_END_PROLOGUE (FILE *file)
 
+  .. hook-start:TARGET_ASM_FUNCTION_END_PROLOGUE
+
   If defined, a function that outputs assembler code at the end of a
   prologue.  This should be used when the function prologue is being
   emitted as RTL, and you have some extra assembler that needs to be
   emitted.  See :ref:`prologue-instruction-pattern`.
 
+.. hook-end
+
 .. function:: void TARGET_ASM_FUNCTION_BEGIN_EPILOGUE (FILE *file)
 
+  .. hook-start:TARGET_ASM_FUNCTION_BEGIN_EPILOGUE
+
   If defined, a function that outputs assembler code at the start of an
   epilogue.  This should be used when the function epilogue is being
   emitted as RTL, and you have some extra assembler that needs to be
   emitted.  See :ref:`epilogue-instruction-pattern`.
 
+.. hook-end
+
 .. function:: void TARGET_ASM_FUNCTION_EPILOGUE (FILE *file)
 
+  .. hook-start:TARGET_ASM_FUNCTION_EPILOGUE
+
   If defined, a function that outputs the assembler code for exit from a
   function.  The epilogue is responsible for restoring the saved
   registers and stack pointer to their values when the function was
@@ -136,6 +154,8 @@ This section describes the macros that output function entry
   function's arguments that this function should pop is available in
   ``crtl->args.pops_args``.  See :ref:`scalar-return`.
 
+.. hook-end
+
 *
   .. index:: pretend_args_size
 
@@ -197,6 +217,8 @@ This section describes the macros that output function entry
 
 .. function:: void TARGET_ASM_OUTPUT_MI_THUNK (FILE *file, tree thunk_fndecl, HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset, tree function)
 
+  .. hook-start:TARGET_ASM_OUTPUT_MI_THUNK
+
   A function that outputs the assembler code for a thunk
   function, used to implement C++ virtual function calls with multiple
   inheritance.  The thunk acts as a wrapper around a virtual function,
@@ -237,10 +259,16 @@ This section describes the macros that output function entry
   :samp:`{function}` instead of jumping to it.  The generic approach does
   not support varargs.
 
+.. hook-end
+
 .. function:: bool TARGET_ASM_CAN_OUTPUT_MI_THUNK (const_tree thunk_fndecl, HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset, const_tree function)
 
+  .. hook-start:TARGET_ASM_CAN_OUTPUT_MI_THUNK
+
   A function that returns true if TARGET_ASM_OUTPUT_MI_THUNK would be able
   to output the assembler code for the thunk function specified by the
   arguments it is passed, and false otherwise.  In the latter case, the
   generic approach will be used by the C++ front end, with the limitations
-  previously exposed.
\ No newline at end of file
+  previously exposed.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/generating-code-for-profiling.rst b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/generating-code-for-profiling.rst
index b2607f35bbf..238f0e2a0e6 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/generating-code-for-profiling.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/generating-code-for-profiling.rst
@@ -50,8 +50,12 @@ These macros will help you generate code for profiling.
 
 .. function:: bool TARGET_KEEP_LEAF_WHEN_PROFILED (void)
 
+  .. hook-start:TARGET_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.
\ No newline at end of file
+  mcount is generated before the function prologue.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/how-large-values-are-returned.rst b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/how-large-values-are-returned.rst
index 6c1a47f79f2..2951cc45ce4 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/how-large-values-are-returned.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/how-large-values-are-returned.rst
@@ -28,6 +28,8 @@ memory.
 
 .. function:: bool TARGET_RETURN_IN_MEMORY (const_tree type, const_tree fntype)
 
+  .. hook-start:TARGET_RETURN_IN_MEMORY
+
   This target hook should return a nonzero value to say to return the
   function value in memory, just as large structures are always returned.
   Here :samp:`{type}` will be the data type of the value, and :samp:`{fntype}`
@@ -45,6 +47,8 @@ memory.
   be returned in memory.  You should instead use ``DEFAULT_PCC_STRUCT_RETURN``
   to indicate this.
 
+.. hook-end
+
 .. c:macro:: DEFAULT_PCC_STRUCT_RETURN
 
   Define this macro to be 1 if all structure and union return values must be
@@ -58,6 +62,8 @@ memory.
 
 .. function:: rtx TARGET_STRUCT_VALUE_RTX (tree fndecl, int incoming)
 
+  .. hook-start:TARGET_STRUCT_VALUE_RTX
+
   This target hook should return the location of the structure value
   address (normally a ``mem`` or ``reg`` ), or 0 if the address is
   passed as an 'invisible' first argument.  Note that :samp:`{fndecl}` may
@@ -79,6 +85,8 @@ memory.
   structure value address at the beginning of a function.  If you need
   to emit adjusting code, you should do it at this point.
 
+.. hook-end
+
 .. c:macro:: PCC_STATIC_STRUCT_RETURN
 
   Define this macro if the usual system convention on the target machine
@@ -93,22 +101,38 @@ memory.
 
 .. function:: fixed_size_mode TARGET_GET_RAW_RESULT_MODE (int regno)
 
+  .. hook-start:TARGET_GET_RAW_RESULT_MODE
+
   This target hook returns the mode to be used when accessing raw return
   registers in ``__builtin_return``.  Define this macro if the value
   in :samp:`{reg_raw_mode}` is not correct.
 
+.. hook-end
+
 .. function:: fixed_size_mode TARGET_GET_RAW_ARG_MODE (int regno)
 
+  .. hook-start:TARGET_GET_RAW_ARG_MODE
+
   This target hook returns the mode to be used when accessing raw argument
   registers in ``__builtin_apply_args``.  Define this macro if the value
   in :samp:`{reg_raw_mode}` is not correct.
 
+.. hook-end
+
 .. function:: bool TARGET_EMPTY_RECORD_P (const_tree type)
 
+  .. hook-start:TARGET_EMPTY_RECORD_P
+
   This target hook returns true if the type is an empty record.  The default
   is to return ``false``.
 
+.. hook-end
+
 .. function:: void TARGET_WARN_PARAMETER_PASSING_ABI (cumulative_args_t ca, tree type)
 
+  .. hook-start:TARGET_WARN_PARAMETER_PASSING_ABI
+
   This target hook warns about the change in empty class parameter passing
-  ABI.
\ No newline at end of file
+  ABI.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/how-scalar-function-values-are-returned.rst b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/how-scalar-function-values-are-returned.rst
index 4437b2d72bc..57c24c5e72b 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/how-scalar-function-values-are-returned.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/how-scalar-function-values-are-returned.rst
@@ -19,6 +19,8 @@ values---values that can fit in registers.
 
 .. function:: rtx TARGET_FUNCTION_VALUE (const_tree ret_type, const_tree fn_decl_or_type, bool outgoing)
 
+  .. hook-start:TARGET_FUNCTION_VALUE
+
   Define this to return an RTX representing the place where a function
   returns or receives a value of data type :samp:`{ret_type}`, a tree node
   representing a data type.  :samp:`{fn_decl_or_type}` is a tree node
@@ -60,6 +62,8 @@ values---values that can fit in registers.
   aggregate data types, because these are returned in another way.  See
   ``TARGET_STRUCT_VALUE_RTX`` and related macros, below.
 
+.. hook-end
+
 .. c:macro:: FUNCTION_VALUE (valtype, func)
 
   This macro has been deprecated.  Use ``TARGET_FUNCTION_VALUE`` for
@@ -77,6 +81,8 @@ values---values that can fit in registers.
 
 .. function:: rtx TARGET_LIBCALL_VALUE (machine_mode mode, const_rtx fun)
 
+  .. hook-start:TARGET_LIBCALL_VALUE
+
   Define this hook if the back-end needs to know the name of the libcall
   function in order to determine where the result should be returned.
 
@@ -86,6 +92,8 @@ values---values that can fit in registers.
 
   If this hook is not defined, then LIBCALL_VALUE will be used.
 
+.. hook-end
+
 .. c:macro:: FUNCTION_VALUE_REGNO_P (regno)
 
   A C expression that is nonzero if :samp:`{regno}` is the number of a hard
@@ -109,6 +117,8 @@ values---values that can fit in registers.
 
 .. function:: bool TARGET_FUNCTION_VALUE_REGNO_P (const unsigned int regno)
 
+  .. hook-start:TARGET_FUNCTION_VALUE_REGNO_P
+
   A target hook that return ``true`` if :samp:`{regno}` is the number of a hard
   register in which the values of called function may come back.
 
@@ -122,6 +132,8 @@ values---values that can fit in registers.
 
   If this hook is not defined, then FUNCTION_VALUE_REGNO_P will be used.
 
+.. hook-end
+
 .. c:macro:: APPLY_RESULT_SIZE
 
   Define this macro if :samp:`untyped_call` and :samp:`untyped_return`
@@ -130,14 +142,20 @@ values---values that can fit in registers.
 
 .. c:var:: bool TARGET_OMIT_STRUCT_RETURN_REG
 
+  .. hook-start:TARGET_OMIT_STRUCT_RETURN_REG
+
   Normally, when a function returns a structure by memory, the address
   is passed as an invisible pointer argument, but the compiler also
   arranges to return the address from the function like it would a normal
   pointer return value.  Define this to true if that behavior is
   undesirable on your target.
 
+.. hook-end
+
 .. function:: bool TARGET_RETURN_IN_MSB (const_tree type)
 
+  .. hook-start:TARGET_RETURN_IN_MSB
+
   This hook should return true if values of type :samp:`{type}` are returned
   at the most significant end of a register (in other words, if they are
   padded at the least significant end).  You can assume that :samp:`{type}`
@@ -147,4 +165,6 @@ values---values that can fit in registers.
   be able to hold the complete return value.  For example, if a 1-, 2-
   or 3-byte structure is returned at the most significant end of a
   4-byte register, ``TARGET_FUNCTION_VALUE`` should provide an
-  ``SImode`` rtx.
\ No newline at end of file
+  ``SImode`` rtx.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/miscellaneous-register-hooks.rst b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/miscellaneous-register-hooks.rst
index 5694f4fa80e..55bb294057f 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/miscellaneous-register-hooks.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/miscellaneous-register-hooks.rst
@@ -12,6 +12,8 @@ Miscellaneous register hooks
 
 .. c:var:: bool TARGET_CALL_FUSAGE_CONTAINS_NON_CALLEE_CLOBBERS
 
+  .. hook-start:TARGET_CALL_FUSAGE_CONTAINS_NON_CALLEE_CLOBBERS
+
   Set to true if each call that binds to a local definition explicitly
   clobbers or sets all non-fixed registers modified by performing the call.
   That is, by the call pattern itself, or by code that might be inserted by the
@@ -19,4 +21,6 @@ Miscellaneous register hooks
   modifiable by the callee.  The affected registers may be mentioned explicitly
   in the call pattern, or included as clobbers in CALL_INSN_FUNCTION_USAGE.
   The default version of this hook is set to false.  The purpose of this hook
-  is to enable the fipa-ra optimization.
\ No newline at end of file
+  is to enable the fipa-ra optimization.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/passing-arguments-in-registers.rst b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/passing-arguments-in-registers.rst
index 74db7e672b7..f0cb6e299c3 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/passing-arguments-in-registers.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/passing-arguments-in-registers.rst
@@ -18,6 +18,8 @@ the stack.
 
 .. function:: rtx TARGET_FUNCTION_ARG (cumulative_args_t ca, const function_arg_info &arg)
 
+  .. hook-start:TARGET_FUNCTION_ARG
+
   Return an RTX indicating whether function argument :samp:`{arg}` is passed
   in a register and if so, which register.  Argument :samp:`{ca}` summarizes all
   the previous arguments.
@@ -70,15 +72,23 @@ the stack.
   defined, the argument will be computed in the stack and then loaded into
   a register.
 
+.. hook-end
+
 .. function:: bool TARGET_MUST_PASS_IN_STACK (const function_arg_info &arg)
 
+  .. hook-start:TARGET_MUST_PASS_IN_STACK
+
   This target hook should return ``true`` if we should not pass :samp:`{arg}`
   solely in registers.  The file :samp:`expr.h` defines a
   definition that is usually appropriate, refer to :samp:`expr.h` for additional
   documentation.
 
+.. hook-end
+
 .. function:: rtx TARGET_FUNCTION_INCOMING_ARG (cumulative_args_t ca, const function_arg_info &arg)
 
+  .. hook-start:TARGET_FUNCTION_INCOMING_ARG
+
   Define this hook if the caller and callee on the target have different
   views of where arguments are passed.  Also define this hook if there are
   functions that are never directly called, but are invoked by the hardware
@@ -97,18 +107,30 @@ the stack.
   If ``TARGET_FUNCTION_INCOMING_ARG`` is not defined,
   ``TARGET_FUNCTION_ARG`` serves both purposes.
 
+.. hook-end
+
 .. function:: bool TARGET_USE_PSEUDO_PIC_REG (void)
 
+  .. hook-start:TARGET_USE_PSEUDO_PIC_REG
+
   This hook should return 1 in case pseudo register should be created
   for pic_offset_table_rtx during function expand.
 
+.. hook-end
+
 .. function:: void TARGET_INIT_PIC_REG (void)
 
+  .. hook-start:TARGET_INIT_PIC_REG
+
   Perform a target dependent initialization of pic_offset_table_rtx.
   This hook is called at the start of register allocation.
 
+.. hook-end
+
 .. function:: int TARGET_ARG_PARTIAL_BYTES (cumulative_args_t cum, const function_arg_info &arg)
 
+  .. hook-start:TARGET_ARG_PARTIAL_BYTES
+
   This target hook returns the number of bytes at the beginning of an
   argument that must be put in registers.  The value must be zero for
   arguments that are passed entirely in registers or that are entirely
@@ -126,8 +148,12 @@ the stack.
   register to be used by the caller for this argument; likewise
   ``TARGET_FUNCTION_INCOMING_ARG``, for the called function.
 
+.. hook-end
+
 .. function:: bool TARGET_PASS_BY_REFERENCE (cumulative_args_t cum, const function_arg_info &arg)
 
+  .. hook-start:TARGET_PASS_BY_REFERENCE
+
   This target hook should return ``true`` if argument :samp:`{arg}` at the
   position indicated by :samp:`{cum}` should be passed by reference.  This
   predicate is queried after target independent reasons for being
@@ -138,8 +164,12 @@ the stack.
   The pointer is passed in whatever way is appropriate for passing a pointer
   to that type.
 
+.. hook-end
+
 .. function:: bool TARGET_CALLEE_COPIES (cumulative_args_t cum, const function_arg_info &arg)
 
+  .. hook-start:TARGET_CALLEE_COPIES
+
   The function argument described by the parameters to this hook is
   known to be passed by reference.  The hook should return true if the
   function argument should be copied by the callee instead of copied
@@ -151,6 +181,8 @@ the stack.
 
   The default version of this hook always returns false.
 
+.. hook-end
+
 .. c:macro:: CUMULATIVE_ARGS
 
   A C type for declaring a variable that is used as the first argument
@@ -221,6 +253,8 @@ the stack.
 
 .. function:: void TARGET_FUNCTION_ARG_ADVANCE (cumulative_args_t ca, const function_arg_info &arg)
 
+  .. hook-start:TARGET_FUNCTION_ARG_ADVANCE
+
   This hook updates the summarizer variable pointed to by :samp:`{ca}` to
   advance past argument :samp:`{arg}` in the argument list.  Once this is done,
   the variable :samp:`{cum}` is suitable for analyzing the *following*
@@ -230,16 +264,24 @@ the stack.
   on the stack.  The compiler knows how to track the amount of stack space
   used for arguments without any special help.
 
+.. hook-end
+
 .. function:: HOST_WIDE_INT TARGET_FUNCTION_ARG_OFFSET (machine_mode mode, const_tree type)
 
+  .. hook-start:TARGET_FUNCTION_ARG_OFFSET
+
   This hook returns the number of bytes to add to the offset of an
   argument of type :samp:`{type}` and mode :samp:`{mode}` when passed in memory.
   This is needed for the SPU, which passes ``char`` and ``short``
   arguments in the preferred slot that is in the middle of the quad word
   instead of starting at the top.  The default implementation returns 0.
 
+.. hook-end
+
 .. function:: pad_direction TARGET_FUNCTION_ARG_PADDING (machine_mode mode, const_tree type)
 
+  .. hook-start:TARGET_FUNCTION_ARG_PADDING
+
   This hook determines whether, and in which direction, to pad out
   an argument of mode :samp:`{mode}` and type :samp:`{type}`.  It returns
   ``PAD_UPWARD`` to insert padding above the argument, ``PAD_DOWNWARD``
@@ -254,6 +296,8 @@ the stack.
   big-endian machines, the default is to pad downward for an argument of
   constant size shorter than an ``int``, and upward otherwise.
 
+.. hook-end
+
 .. c:macro:: PAD_VARARGS_DOWN
 
   If defined, a C expression which determines whether the default
@@ -275,17 +319,25 @@ the stack.
 
 .. function:: unsigned int TARGET_FUNCTION_ARG_BOUNDARY (machine_mode mode, const_tree type)
 
+  .. hook-start:TARGET_FUNCTION_ARG_BOUNDARY
+
   This hook returns the alignment boundary, in bits, of an argument
   with the specified mode and type.  The default hook returns
   ``PARM_BOUNDARY`` for all arguments.
 
+.. hook-end
+
 .. function:: unsigned int TARGET_FUNCTION_ARG_ROUND_BOUNDARY (machine_mode mode, const_tree type)
 
+  .. hook-start:TARGET_FUNCTION_ARG_ROUND_BOUNDARY
+
   Normally, the size of an argument is rounded up to ``PARM_BOUNDARY``,
   which is the default value for this hook.  You can define this hook to
   return a different value if an argument size must be rounded to a larger
   value.
 
+.. hook-end
+
 .. c:macro:: FUNCTION_ARG_REGNO_P (regno)
 
   A C expression that is nonzero if :samp:`{regno}` is the number of a hard
@@ -297,6 +349,8 @@ the stack.
 
 .. function:: bool TARGET_SPLIT_COMPLEX_ARG (const_tree type)
 
+  .. hook-start:TARGET_SPLIT_COMPLEX_ARG
+
   This hook should return true if parameter of type :samp:`{type}` are passed
   as two scalar parameters.  By default, GCC will attempt to pack complex
   arguments into the target's word size.  Some ABIs require complex arguments
@@ -308,13 +362,21 @@ the stack.
   The default value of this hook is ``NULL``, which is treated as always
   false.
 
+.. hook-end
+
 .. function:: tree TARGET_BUILD_BUILTIN_VA_LIST (void)
 
+  .. hook-start:TARGET_BUILD_BUILTIN_VA_LIST
+
   This hook returns a type node for ``va_list`` for the target.
   The default version of the hook returns ``void*``.
 
+.. hook-end
+
 .. function:: int TARGET_ENUM_VA_LIST_P (int idx, const char **pname, tree *ptree)
 
+  .. hook-start:TARGET_ENUM_VA_LIST_P
+
   This target hook is used in function ``c_common_nodes_and_builtins``
   to iterate through the target specific builtin types for va_list. The
   variable :samp:`{idx}` is used as iterator. :samp:`{pname}` has to be a pointer
@@ -327,49 +389,77 @@ the stack.
   Otherwise the :samp:`{IDX}` should be increased for the next call of this
   macro to iterate through all types.
 
+.. hook-end
+
 .. function:: tree TARGET_FN_ABI_VA_LIST (tree fndecl)
 
+  .. hook-start:TARGET_FN_ABI_VA_LIST
+
   This hook returns the va_list type of the calling convention specified by
   :samp:`{fndecl}`.
   The default version of this hook returns ``va_list_type_node``.
 
+.. hook-end
+
 .. function:: tree TARGET_CANONICAL_VA_LIST_TYPE (tree type)
 
+  .. hook-start:TARGET_CANONICAL_VA_LIST_TYPE
+
   This hook returns the va_list type of the calling convention specified by the
   type of :samp:`{type}`. If :samp:`{type}` is not a valid va_list type, it returns
   ``NULL_TREE``.
 
+.. hook-end
+
 .. function:: tree TARGET_GIMPLIFY_VA_ARG_EXPR (tree valist, tree type, gimple_seq *pre_p, gimple_seq *post_p)
 
+  .. hook-start:TARGET_GIMPLIFY_VA_ARG_EXPR
+
   This hook performs target-specific gimplification of
   ``VA_ARG_EXPR``.  The first two parameters correspond to the
   arguments to ``va_arg`` ; the latter two are as in
   ``gimplify.c:gimplify_expr``.
 
+.. hook-end
+
 .. function:: bool TARGET_VALID_POINTER_MODE (scalar_int_mode mode)
 
+  .. hook-start:TARGET_VALID_POINTER_MODE
+
   Define this to return nonzero if the port can handle pointers
   with machine mode :samp:`{mode}`.  The default version of this
   hook returns true for both ``ptr_mode`` and ``Pmode``.
 
+.. hook-end
+
 .. function:: bool TARGET_REF_MAY_ALIAS_ERRNO (ao_ref *ref)
 
+  .. hook-start:TARGET_REF_MAY_ALIAS_ERRNO
+
   Define this to return nonzero if the memory reference :samp:`{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.
 
+.. hook-end
+
 .. function:: machine_mode TARGET_TRANSLATE_MODE_ATTRIBUTE (machine_mode mode)
 
+  .. hook-start:TARGET_TRANSLATE_MODE_ATTRIBUTE
+
   Define this hook if during mode attribute processing, the port should
   translate machine_mode :samp:`{mode}` to another mode.  For example, rs6000's
   ``KFmode``, when it is the same as ``TFmode``.
 
   The default version of the hook returns that mode that was passed in.
 
+.. hook-end
+
 .. function:: bool TARGET_SCALAR_MODE_SUPPORTED_P (scalar_mode mode)
 
+  .. hook-start:TARGET_SCALAR_MODE_SUPPORTED_P
+
   Define this to return nonzero if the port is prepared to handle
   insns involving scalar mode :samp:`{mode}`.  For a scalar mode to be
   considered supported, all the basic arithmetic and comparisons
@@ -380,14 +470,22 @@ the stack.
   Included here are the double-word arithmetic supported by the
   code in :samp:`optabs.c`.
 
+.. hook-end
+
 .. function:: bool TARGET_VECTOR_MODE_SUPPORTED_P (machine_mode mode)
 
+  .. hook-start:TARGET_VECTOR_MODE_SUPPORTED_P
+
   Define this to return nonzero if the port is prepared to handle
   insns involving vector mode :samp:`{mode}`.  At the very least, it
   must have move patterns for this mode.
 
+.. hook-end
+
 .. function:: bool TARGET_COMPATIBLE_VECTOR_TYPES_P (const_tree type1, const_tree type2)
 
+  .. hook-start:TARGET_COMPATIBLE_VECTOR_TYPES_P
+
   Return true if there is no target-specific reason for treating
   vector types :samp:`{type1}` and :samp:`{type2}` as distinct types.  The caller
   has already checked for target-independent reasons, meaning that the
@@ -407,8 +505,12 @@ the stack.
 
   The default implementation returns true, which is correct for most targets.
 
+.. hook-end
+
 .. function:: opt_machine_mode TARGET_ARRAY_MODE (machine_mode mode, unsigned HOST_WIDE_INT nelems)
 
+  .. hook-start:TARGET_ARRAY_MODE
+
   Return the mode that GCC should use for an array that has
   :samp:`{nelems}` elements, with each element having mode :samp:`{mode}`.
   Return no mode if the target has no special requirements.  In the
@@ -421,8 +523,12 @@ the stack.
   The main use of this hook is to specify that an array of vectors should
   also have a vector mode.  The default implementation returns no mode.
 
+.. hook-end
+
 .. function:: bool TARGET_ARRAY_MODE_SUPPORTED_P (machine_mode mode, unsigned HOST_WIDE_INT nelems)
 
+  .. hook-start:TARGET_ARRAY_MODE_SUPPORTED_P
+
   Return true if GCC should try to use a scalar mode to store an array
   of :samp:`{nelems}` elements, given that each element has mode :samp:`{mode}`.
   Returning true here overrides the usual ``MAX_FIXED_MODE`` limit
@@ -449,16 +555,24 @@ the stack.
   ``int8x8x3_t`` can have the same mode.  GCC can then store
   ``int8x8x3_t`` s in registers rather than forcing them onto the stack.
 
+.. hook-end
+
 .. function:: bool TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P (scalar_float_mode mode)
 
+  .. hook-start:TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P
+
   Define this to return nonzero if libgcc provides support for the
   floating-point mode :samp:`{mode}`, which is known to pass
   ``TARGET_SCALAR_MODE_SUPPORTED_P``.  The default version of this
   hook returns true for all of ``SFmode``, ``DFmode``,
   ``XFmode`` and ``TFmode``, if such modes exist.
 
+.. hook-end
+
 .. function:: opt_scalar_float_mode TARGET_FLOATN_MODE (int n, bool extended)
 
+  .. hook-start:TARGET_FLOATN_MODE
+
   Define this to return the machine mode to use for the type
   ``_Floatn``, if :samp:`{extended}` is false, or the type
   ``_Floatnx``, if :samp:`{extended}` is true.  If such a type is not
@@ -475,8 +589,12 @@ the stack.
   ISO/IEC TS 18661-3:2015; that is, :samp:`{n}` is one of 32, 64, 128, or,
   if :samp:`{extended}` is false, 16 or greater than 128 and a multiple of 32.
 
+.. hook-end
+
 .. function:: bool TARGET_FLOATN_BUILTIN_P (int func)
 
+  .. hook-start:TARGET_FLOATN_BUILTIN_P
+
   Define this to return true if the ``_Floatn`` and
   ``_Floatnx`` built-in functions should implicitly enable the
   built-in function without the ``__builtin_`` prefix in addition to the
@@ -486,8 +604,12 @@ the stack.
   the ``__builtin_`` prefix is not enabled.  The argument ``FUNC`` is the
   ``enum built_in_function`` id of the function to be enabled.
 
+.. hook-end
+
 .. function:: bool TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P (machine_mode mode)
 
+  .. hook-start:TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P
+
   Define this to return nonzero for machine modes for which the port has
   small register classes.  If this target hook returns nonzero for a given
   :samp:`{mode}`, the compiler will try to minimize the lifetime of registers
@@ -516,4 +638,6 @@ the stack.
   unnecessarily define it, you will reduce the amount of optimizations
   that can be performed in some cases.  If you do not define this hook
   to return a nonzero value when it is required, the compiler will run out
-  of spill registers and print a fatal error message.
\ No newline at end of file
+  of spill registers and print a fatal error message.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/passing-function-arguments-on-the-stack.rst b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/passing-function-arguments-on-the-stack.rst
index c2ee25345fd..d3985d625dc 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/passing-function-arguments-on-the-stack.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/passing-function-arguments-on-the-stack.rst
@@ -18,14 +18,20 @@ control passing certain arguments in registers.
 
 .. function:: bool TARGET_PROMOTE_PROTOTYPES (const_tree fntype)
 
+  .. hook-start:TARGET_PROMOTE_PROTOTYPES
+
   This target hook returns ``true`` if an argument declared in a
   prototype as an integral type smaller than ``int`` should actually be
   passed as an ``int``.  In addition to avoiding errors in certain
   cases of mismatch, it also makes for better code on certain machines.
   The default is to not promote prototypes.
 
+.. hook-end
+
 .. function:: bool TARGET_PUSH_ARGUMENT (unsigned int npush)
 
+  .. hook-start:TARGET_PUSH_ARGUMENT
+
   This target hook returns ``true`` if push instructions will be
   used to pass outgoing arguments.  When the push instruction usage is
   optional, :samp:`{npush}` is nonzero to indicate the number of bytes to
@@ -36,6 +42,8 @@ control passing certain arguments in registers.
   arguments into it.  If this target hook may return ``true``,
   ``PUSH_ROUNDING`` must be defined.
 
+.. hook-end
+
 .. c:macro:: PUSH_ARGS_REVERSED
 
   A C expression.  If nonzero, function arguments will be evaluated from
@@ -96,7 +104,8 @@ control passing certain arguments in registers.
   which.
 
 .. above is overfull.  not sure what to do.  -mew 5feb93  did
-   something, not sure if it looks good.  -mew 10feb93
+
+.. something, not sure if it looks good.  -mew 10feb93
 
 .. c:macro:: INCOMING_REG_PARM_STACK_SPACE (fndecl)
 
@@ -132,6 +141,8 @@ control passing certain arguments in registers.
 
 .. function:: poly_int64 TARGET_RETURN_POPS_ARGS (tree fundecl, tree funtype, poly_int64 size)
 
+  .. hook-start:TARGET_RETURN_POPS_ARGS
+
   This target hook returns the number of bytes of its own arguments that
   a function pops on returning, or 0 if the function pops no arguments
   and the caller must therefore pop them all after the function returns.
@@ -168,6 +179,8 @@ control passing certain arguments in registers.
   :samp:`{funtype}` is examined to determine whether a function takes a fixed
   number of arguments.
 
+.. hook-end
+
 .. c:macro:: CALL_POPS_ARGS (cum)
 
   A C expression that should indicate the number of bytes a call sequence
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/permitting-tail-calls.rst b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/permitting-tail-calls.rst
index ae19cb89ab4..af1305ad1cc 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/permitting-tail-calls.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/permitting-tail-calls.rst
@@ -12,6 +12,8 @@ Permitting tail calls
 
 .. function:: bool TARGET_FUNCTION_OK_FOR_SIBCALL (tree decl, tree exp)
 
+  .. hook-start:TARGET_FUNCTION_OK_FOR_SIBCALL
+
   True if it is OK to do sibling call optimization for the specified
   call expression :samp:`{exp}`.  :samp:`{decl}` will be the called function,
   or ``NULL`` if this is an indirect call.
@@ -23,8 +25,12 @@ Permitting tail calls
   'normal' call.  The criteria for successful sibling call optimization
   may vary greatly between different architectures.
 
+.. hook-end
+
 .. function:: void TARGET_EXTRA_LIVE_ON_ENTRY (bitmap regs)
 
+  .. hook-start:TARGET_EXTRA_LIVE_ON_ENTRY
+
   Add any hard registers to :samp:`{regs}` that are live on entry to the
   function.  This hook only needs to be defined to provide registers that
   cannot be found by examination of FUNCTION_ARG_REGNO_P, the callee saved
@@ -32,13 +38,23 @@ Permitting tail calls
   TARGET_STRUCT_VALUE_RTX, FRAME_POINTER_REGNUM, EH_USES,
   FRAME_POINTER_REGNUM, ARG_POINTER_REGNUM, and the PIC_OFFSET_TABLE_REGNUM.
 
+.. hook-end
+
 .. function:: void TARGET_SET_UP_BY_PROLOGUE (struct hard_reg_set_container *)
 
+  .. hook-start:TARGET_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.
 
+.. hook-end
+
 .. function:: bool TARGET_WARN_FUNC_RETURN (tree)
 
+  .. hook-start:TARGET_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.
\ No newline at end of file
+  of a non-void function.  Return false if no such check should be made.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/registers-that-address-the-stack-frame.rst b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/registers-that-address-the-stack-frame.rst
index 661f312a141..e9285c8c40d 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/registers-that-address-the-stack-frame.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/registers-that-address-the-stack-frame.rst
@@ -104,6 +104,8 @@ This discusses registers that address the stack frame.
 
 .. function:: rtx TARGET_STATIC_CHAIN (const_tree fndecl_or_type, bool incoming_p)
 
+  .. hook-start:TARGET_STATIC_CHAIN
+
   This hook replaces the use of ``STATIC_CHAIN_REGNUM`` et al for
   targets that may use different static chain locations for different
   nested functions.  This may be required if the target has function
@@ -128,6 +130,8 @@ This discusses registers that address the stack frame.
   ``arg_pointer_rtx`` will have been initialized and should be used
   to refer to those items.
 
+.. hook-end
+
 .. c:macro:: DWARF_FRAME_REGISTERS
 
   This macro specifies the maximum number of hard registers that can be
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/shrink-wrapping-separate-components.rst b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/shrink-wrapping-separate-components.rst
index 869b912a3f5..b7267da627b 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/shrink-wrapping-separate-components.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/shrink-wrapping-separate-components.rst
@@ -33,6 +33,8 @@ generic code.
 
 .. function:: sbitmap TARGET_SHRINK_WRAP_GET_SEPARATE_COMPONENTS (void)
 
+  .. hook-start:TARGET_SHRINK_WRAP_GET_SEPARATE_COMPONENTS
+
   This hook should return an ``sbitmap`` with the bits set for those
   components that can be separately shrink-wrapped in the current function.
   Return ``NULL`` if the current function should not get any separate
@@ -40,30 +42,52 @@ generic code.
   Don't define this hook if it would always return ``NULL``.
   If it is defined, the other hooks in this group have to be defined as well.
 
+.. hook-end
+
 .. function:: sbitmap TARGET_SHRINK_WRAP_COMPONENTS_FOR_BB (basic_block)
 
+  .. hook-start:TARGET_SHRINK_WRAP_COMPONENTS_FOR_BB
+
   This hook should return an ``sbitmap`` with the bits set for those
   components where either the prologue component has to be executed before
   the ``basic_block``, or the epilogue component after it, or both.
 
+.. hook-end
+
 .. function:: void TARGET_SHRINK_WRAP_DISQUALIFY_COMPONENTS (sbitmap components, edge e, sbitmap edge_components, bool is_prologue)
 
+  .. hook-start:TARGET_SHRINK_WRAP_DISQUALIFY_COMPONENTS
+
   This hook should clear the bits in the :samp:`{components}` bitmap for those
   components in :samp:`{edge_components}` that the target cannot handle on edge
   :samp:`{e}`, where :samp:`{is_prologue}` says if this is for a prologue or an
   epilogue instead.
 
+.. hook-end
+
 .. function:: void TARGET_SHRINK_WRAP_EMIT_PROLOGUE_COMPONENTS (sbitmap)
 
+  .. hook-start:TARGET_SHRINK_WRAP_EMIT_PROLOGUE_COMPONENTS
+
   Emit prologue insns for the components indicated by the parameter.
 
+.. hook-end
+
 .. function:: void TARGET_SHRINK_WRAP_EMIT_EPILOGUE_COMPONENTS (sbitmap)
 
+  .. hook-start:TARGET_SHRINK_WRAP_EMIT_EPILOGUE_COMPONENTS
+
   Emit epilogue insns for the components indicated by the parameter.
 
+.. hook-end
+
 .. function:: void TARGET_SHRINK_WRAP_SET_HANDLED_COMPONENTS (sbitmap)
 
+  .. hook-start:TARGET_SHRINK_WRAP_SET_HANDLED_COMPONENTS
+
   Mark the components in the parameter as handled, so that the
   ``prologue`` and ``epilogue`` named patterns know to ignore those
   components.  The target code should not hang on to the ``sbitmap``, it
-  will be deleted after this call.
\ No newline at end of file
+  will be deleted after this call.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/specifying-how-stack-checking-is-done.rst b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/specifying-how-stack-checking-is-done.rst
index 137475b07b9..72ce1a09d19 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/specifying-how-stack-checking-is-done.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/specifying-how-stack-checking-is-done.rst
@@ -104,6 +104,8 @@ in the opposite case.
 
 .. function:: HOST_WIDE_INT TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE (void)
 
+  .. hook-start:TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE
+
   Some targets have an ABI defined interval for which no probing needs to be done.
   When a probe does need to be done this same interval is used as the probe distance
   up when doing stack clash protection for alloca.
@@ -111,4 +113,6 @@ in the opposite case.
   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
   of outgoing arguments.  If this is not the case the stack will be corrupted.
-  You need not define this macro if it would always have the value zero.
\ No newline at end of file
+  You need not define this macro if it would always have the value zero.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/stack-smashing-protection.rst b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/stack-smashing-protection.rst
index 83834030a3f..19c6cd0b2c6 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/stack-smashing-protection.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/stack-layout-and-calling-conventions/stack-smashing-protection.rst
@@ -12,6 +12,8 @@ Stack smashing protection
 
 .. function:: tree TARGET_STACK_PROTECT_GUARD (void)
 
+  .. hook-start:TARGET_STACK_PROTECT_GUARD
+
   This hook returns a ``DECL`` node for the external variable to use
   for the stack protection guard.  This variable is initialized by the
   runtime to some random value and is used to initialize the guard value
@@ -21,8 +23,12 @@ Stack smashing protection
   The default version of this hook creates a variable called
   :samp:`__stack_chk_guard`, which is normally defined in :samp:`libgcc2.c`.
 
+.. hook-end
+
 .. function:: tree TARGET_STACK_PROTECT_FAIL (void)
 
+  .. hook-start:TARGET_STACK_PROTECT_FAIL
+
   This hook returns a ``CALL_EXPR`` that alerts the runtime that the
   stack protect guard variable has been modified.  This expression should
   involve a call to a ``noreturn`` function.
@@ -31,13 +37,21 @@ Stack smashing protection
   :samp:`__stack_chk_fail`, taking no arguments.  This function is
   normally defined in :samp:`libgcc2.c`.
 
+.. hook-end
+
 .. function:: bool TARGET_STACK_PROTECT_RUNTIME_ENABLED_P (void)
 
+  .. hook-start:TARGET_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.
 
+.. hook-end
+
 .. function:: bool TARGET_SUPPORTS_SPLIT_STACK (bool report, struct gcc_options *opts)
 
+  .. hook-start:TARGET_SUPPORTS_SPLIT_STACK
+
   Whether this target supports splitting the stack when the options
   described in :samp:`{opts}` have been passed.  This is called
   after options have been parsed, so the target may reject splitting
@@ -45,11 +59,17 @@ Stack smashing protection
   returns false.  If :samp:`{report}` is true, this function may issue a warning
   or error; if :samp:`{report}` is false, it must simply return a value
 
+.. hook-end
+
 .. function:: vec<const char *> TARGET_GET_VALID_OPTION_VALUES (int option_code, const char *prefix)
 
+  .. hook-start:TARGET_GET_VALID_OPTION_VALUES
+
   The hook is used for options that have a non-trivial list of
   possible option values.  OPTION_CODE is option code of opt_code
   enum type.  PREFIX is used for bash completion and allows an implementation
   to return more specific completion based on the prefix.  All string values
   should be allocated from heap memory and consumers should release them.
-  The result will be pruned to cases with PREFIX if not NULL.
\ No newline at end of file
+  The result will be pruned to cases with PREFIX if not NULL.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/storage-layout.rst b/gcc/doc/gccint/target-description-macros-and-functions/storage-layout.rst
index d6fc964b41b..b59dd9b3681 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/storage-layout.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/storage-layout.rst
@@ -123,6 +123,8 @@ See :ref:`run-time-target`.
 
 .. function:: enum flt_eval_method TARGET_C_EXCESS_PRECISION (enum excess_precision_type type)
 
+  .. hook-start:TARGET_C_EXCESS_PRECISION
+
   Return a value, with the same meaning as the C99 macro
   ``FLT_EVAL_METHOD`` that describes which excess precision should be
   applied.  :samp:`{type}` is either ``EXCESS_PRECISION_TYPE_IMPLICIT``,
@@ -140,8 +142,12 @@ See :ref:`run-time-target`.
   when :samp:`{type}` is ``EXCESS_PRECISION_TYPE_STANDARD`` or
   ``EXCESS_PRECISION_TYPE_FAST``.
 
+.. hook-end
+
 .. function:: machine_mode TARGET_PROMOTE_FUNCTION_MODE (const_tree type, machine_mode mode, int *punsignedp, const_tree funtype, int for_return)
 
+  .. hook-start:TARGET_PROMOTE_FUNCTION_MODE
+
   Like ``PROMOTE_MODE``, but it is applied to outgoing function arguments or
   function return values.  The target hook should return the new mode
   and possibly change ``*punsignedp`` if the promotion should
@@ -162,6 +168,8 @@ See :ref:`run-time-target`.
   also define the hook to ``default_promote_function_mode_always_promote``
   if you would like to apply the same rules given by ``PROMOTE_MODE``.
 
+.. hook-end
+
 .. c:macro:: PARM_BOUNDARY
 
   Normal alignment required for function parameters on the stack, in
@@ -203,10 +211,14 @@ See :ref:`run-time-target`.
 
 .. c:var:: HOST_WIDE_INT TARGET_ABSOLUTE_BIGGEST_ALIGNMENT
 
+  .. hook-start:TARGET_ABSOLUTE_BIGGEST_ALIGNMENT
+
   If defined, this target hook specifies the absolute biggest alignment
   that a type or variable can have on this machine, otherwise,
   ``BIGGEST_ALIGNMENT`` is used.
 
+.. hook-end
+
 .. c:macro:: MALLOC_ABI_ALIGNMENT
 
   Alignment, in bits, a C conformant malloc implementation has to
@@ -272,16 +284,24 @@ See :ref:`run-time-target`.
 
 .. function:: void TARGET_LOWER_LOCAL_DECL_ALIGNMENT (tree decl)
 
+  .. hook-start:TARGET_LOWER_LOCAL_DECL_ALIGNMENT
+
   Define this hook to lower alignment of local, parm or result
   decl :samp:`({decl})`.
 
+.. hook-end
+
 .. function:: HOST_WIDE_INT TARGET_STATIC_RTX_ALIGNMENT (machine_mode mode)
 
+  .. hook-start:TARGET_STATIC_RTX_ALIGNMENT
+
   This hook returns the preferred alignment in bits for a
   statically-allocated rtx, such as a constant pool entry.  :samp:`{mode}`
   is the mode of the rtx.  The default implementation returns
   :samp:`GET_MODE_ALIGNMENT ({mode})`.
 
+.. hook-end
+
 .. c:macro:: DATA_ALIGNMENT (type, basic-align)
 
   If defined, a C expression to compute the alignment for a variable in
@@ -308,6 +328,8 @@ See :ref:`run-time-target`.
 
 .. function:: HOST_WIDE_INT TARGET_CONSTANT_ALIGNMENT (const_tree constant, HOST_WIDE_INT basic_align)
 
+  .. hook-start:TARGET_CONSTANT_ALIGNMENT
+
   This hook returns the alignment in bits of a constant that is being
   placed in memory.  :samp:`{constant}` is the constant and :samp:`{basic_align}`
   is the alignment that the object would ordinarily have.
@@ -319,6 +341,8 @@ See :ref:`run-time-target`.
   constants can be done inline.  The function
   ``constant_alignment_word_strings`` provides such a definition.
 
+.. hook-end
+
 .. c:macro:: LOCAL_ALIGNMENT (type, basic-align)
 
   If defined, a C expression to compute the alignment for a variable in
@@ -335,12 +359,16 @@ See :ref:`run-time-target`.
 
 .. function:: HOST_WIDE_INT TARGET_VECTOR_ALIGNMENT (const_tree type)
 
+  .. hook-start:TARGET_VECTOR_ALIGNMENT
+
   This hook can be used to define the alignment for a vector of type
   :samp:`{type}`, in order to comply with a platform ABI.  The default is to
   require natural alignment for vector types.  The alignment returned by
   this hook must be a power-of-two multiple of the default alignment of
   the vector element type.
 
+.. hook-end
+
 .. c:macro:: STACK_SLOT_ALIGNMENT (type, mode, basic-align)
 
   If defined, a C expression to compute the alignment for stack slot.
@@ -475,21 +503,31 @@ See :ref:`run-time-target`.
 
 .. function:: bool TARGET_ALIGN_ANON_BITFIELD (void)
 
+  .. hook-start:TARGET_ALIGN_ANON_BITFIELD
+
   When ``PCC_BITFIELD_TYPE_MATTERS`` is true this hook will determine
   whether unnamed bitfields affect the alignment of the containing
   structure.  The hook should return true if the structure should inherit
   the alignment requirements of an unnamed bitfield's type.
 
+.. hook-end
+
 .. function:: bool TARGET_NARROW_VOLATILE_BITFIELD (void)
 
+  .. hook-start:TARGET_NARROW_VOLATILE_BITFIELD
+
   This target hook should return ``true`` if accesses to volatile bitfields
   should use the narrowest mode possible.  It should return ``false`` if
   these accesses should use the bitfield container type.
 
   The default is ``false``.
 
+.. hook-end
+
 .. function:: bool TARGET_MEMBER_TYPE_FORCES_BLK (const_tree field, machine_mode mode)
 
+  .. hook-start:TARGET_MEMBER_TYPE_FORCES_BLK
+
   Return true if a structure, union or array containing :samp:`{field}` should
   be accessed using ``BLKMODE``.
 
@@ -500,6 +538,8 @@ See :ref:`run-time-target`.
 
   Normally, this is not needed.
 
+.. hook-end
+
 .. c:macro:: ROUND_TYPE_ALIGN (type, computed, specified)
 
   Define this macro as an expression for the alignment of a type (given
@@ -544,25 +584,39 @@ See :ref:`run-time-target`.
 
 .. function:: scalar_int_mode TARGET_LIBGCC_CMP_RETURN_MODE (void)
 
+  .. hook-start:TARGET_LIBGCC_CMP_RETURN_MODE
+
   This target hook should return the mode to be used for the return value
   of compare instructions expanded to libgcc calls.  If not defined
   ``word_mode`` is returned which is the right choice for a majority of
   targets.
 
+.. hook-end
+
 .. function:: scalar_int_mode TARGET_LIBGCC_SHIFT_COUNT_MODE (void)
 
+  .. hook-start:TARGET_LIBGCC_SHIFT_COUNT_MODE
+
   This target hook should return the mode to be used for the shift count operand
   of shift instructions expanded to libgcc calls.  If not defined
   ``word_mode`` is returned which is the right choice for a majority of
   targets.
 
+.. hook-end
+
 .. function:: scalar_int_mode TARGET_UNWIND_WORD_MODE (void)
 
+  .. hook-start:TARGET_UNWIND_WORD_MODE
+
   Return machine mode to be used for ``_Unwind_Word`` type.
   The default is to use ``word_mode``.
 
+.. hook-end
+
 .. function:: bool TARGET_MS_BITFIELD_LAYOUT_P (const_tree record_type)
 
+  .. hook-start:TARGET_MS_BITFIELD_LAYOUT_P
+
   This target hook returns ``true`` if bit-fields in the given
   :samp:`{record_type}` are to be laid out following the rules of Microsoft
   Visual C/C++, namely: (i) a bit-field won't share the same storage
@@ -589,16 +643,28 @@ See :ref:`run-time-target`.
   precedence for that field, but the alignment of the rest of the structure
   may affect its placement.
 
+.. hook-end
+
 .. function:: bool TARGET_DECIMAL_FLOAT_SUPPORTED_P (void)
 
+  .. hook-start:TARGET_DECIMAL_FLOAT_SUPPORTED_P
+
   Returns true if the target supports decimal floating point.
 
+.. hook-end
+
 .. function:: bool TARGET_FIXED_POINT_SUPPORTED_P (void)
 
+  .. hook-start:TARGET_FIXED_POINT_SUPPORTED_P
+
   Returns true if the target supports fixed-point arithmetic.
 
+.. hook-end
+
 .. function:: void TARGET_EXPAND_TO_RTL_HOOK (void)
 
+  .. hook-start:TARGET_EXPAND_TO_RTL_HOOK
+
   This hook is called just before expansion into rtl, allowing the target
   to perform additional initializations or analysis before the expansion.
   For example, the rs6000 port uses it to allocate a scratch stack slot
@@ -606,13 +672,21 @@ See :ref:`run-time-target`.
   registers whenever the function being expanded has any SDmode
   usage.
 
+.. hook-end
+
 .. function:: void TARGET_INSTANTIATE_DECLS (void)
 
+  .. hook-start:TARGET_INSTANTIATE_DECLS
+
   This hook allows the backend to perform additional instantiations on rtl
   that are not actually in any insns yet, but will be later.
 
+.. hook-end
+
 .. function:: const char * TARGET_MANGLE_TYPE (const_tree type)
 
+  .. hook-start:TARGET_MANGLE_TYPE
+
   If your target defines any fundamental types, or any types your target
   uses should be mangled differently from the default, define this hook
   to return the appropriate encoding for these types as part of a C++
@@ -643,4 +717,6 @@ See :ref:`run-time-target`.
 
   The default version of this hook always returns ``NULL``, which is
   appropriate for a target that does not define any new fundamental
-  types.
\ No newline at end of file
+  types.
+
+.. hook-end
\ No newline at end of file
diff --git a/gcc/doc/gccint/target-description-macros-and-functions/support-for-nested-functions.rst b/gcc/doc/gccint/target-description-macros-and-functions/support-for-nested-functions.rst
index 8eb9d6769a1..0b50c997e77 100644
--- a/gcc/doc/gccint/target-description-macros-and-functions/support-for-nested-functions.rst
+++ b/gcc/doc/gccint/target-description-macros-and-functions/support-for-nested-functions.rst
@@ -57,6 +57,8 @@ for nested functions.
 
 .. c:var:: int TARGET_CUSTOM_FUNCTION_DESCRIPTORS
 
+  .. hook-start:TARGET_CUSTOM_FUNCTION_DESCRIPTORS
+
   If the target can use GCC's generic descriptor mechanism for nested
   functions, define this hook to a power of 2 representing an unused bit
   in function pointers which can be used to differentiate descriptors at
@@ -74,6 +76,8 @@ for nested functions.
   eliminates the need for trampolines that reside on the stack and require
   it to be made executable.
 
+.. hook-end
+
 The following macros tell GCC how to generate code to allocate and
 initialize an executable trampoline.  You can also use this interface
 if your back end needs to create ABI-specified non-executable descriptors; in
@@ -98,6 +102,8 @@ separately.
 
 .. function:: void TARGET_ASM_TRAMPOLINE_TEMPLATE (FILE *f)
 
+  .. hook-start:TARGET_ASM_TRAMPOLINE_TEMPLATE
+
   This hook is called by ``assemble_trampoline_template`` to output,
   on the stream :samp:`{f}`, assembler code for a block of data that contains
   the constant parts of a trampoline.  This code should not include a
@@ -108,6 +114,8 @@ separately.
   code to copy the trampoline into place would be larger than the code
   to generate it on the spot.
 
+.. hook-end
+
 .. c:macro:: TRAMPOLINE_SECTION
 
   Return the section into which the trampoline template is to be placed
@@ -126,6 +134,8 @@ separately.
 
 .. function:: void TARGET_TRAMPOLINE_INIT (rtx m_tramp, tree fndecl, rtx static_chain)
 
+  .. hook-start:TARGET_TRAMPOLINE_INIT
+
   This hook is called to initialize a trampoline.
   :samp:`{m_tramp}` is an RTX for the memory block for the trampoline; :samp:`{fndecl}`
   is the ``FUNCTION_DECL`` for the nested function; :samp:`{static_chain}` is an
@@ -144,8 +154,12 @@ separately.
   enabling stack execution, these actions should be performed after
   initializing the trampoline proper.
 
+.. hook-end
+
 .. function:: void TARGET_EMIT_CALL_BUILTIN___CLEAR_CACHE (rtx begin, rtx end)
 
+  .. hook-start:TARGET_EMIT_CALL_BUILTIN___CLEAR_CACHE
+
   On targets that do not define a ``clear_cache`` insn expander,
   but that define the ``CLEAR_CACHE_INSN`` macro,
   maybe_emit_call_builtin___clear_cache relies on this target hook
@@ -156,8 +170,12 @@ separately.
   definitions may call alternate functions, with alternate calling
   conventions, or emit alternate RTX to perform the job.
 
+.. hook-end
+
 .. function:: rtx TARGET_TRAMPOLINE_ADJUST_ADDRESS (rtx addr)
 
+  .. hook-start:TARGET_TRAMPOLINE_ADJUST_ADDRESS
+
   This hook should perform any machine-specific adjustment in
   the address of the trampoline.  Its argument contains the address of the
   memory block that was passed to ``TARGET_TRAMPOLINE_INIT``.  In case
@@ -166,6 +184,8 @@ separately.
   be returned; otherwise :samp:`{addr}` should be returned unchanged.
   If this hook is not defined, :samp:`{addr}` will be used for function calls.
 
+.. hook-end
+
 Implementing trampolines is difficult on many machines because they have
 separate instruction and data caches.  Writing into a stack location
 fails to clear the memory in the instruction cache, so when the program


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-22 14:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-22 14:54 [gcc(refs/users/marxin/heads/sphinx-v1)] Add hook placeholders for target macros Martin Liska

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).