Mercurial > hg > CbC > CbC_gcc
diff gcc/doc/tm.texi @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
line wrap: on
line diff
--- a/gcc/doc/tm.texi Fri Oct 27 22:46:09 2017 +0900 +++ b/gcc/doc/tm.texi Thu Oct 25 07:37:49 2018 +0900 @@ -1,4 +1,4 @@ -@c Copyright (C) 1988-2017 Free Software Foundation, Inc. +@c Copyright (C) 1988-2018 Free Software Foundation, Inc. @c This is part of the GCC manual. @c For copying conditions, see the file gcc.texi. @@ -753,6 +753,10 @@ Set target-dependent default values for @option{--param} settings, using calls to @code{set_default_param_value}. @end deftypefn +@deftypefn {Common Target Hook} bool TARGET_OPTION_VALIDATE_PARAM (int, @var{int}) +Validate target-dependent value for @option{--param} settings, using calls to @code{set_param_value}. +@end deftypefn + @defmac SWITCHABLE_TARGET Some targets need to switch between substantially different subtargets during compilation. For example, the MIPS target has one subtarget for @@ -2774,6 +2778,17 @@ With LRA, the default is to use @var{mode} unmodified. @end deftypefn +@deftypefn {Target Hook} void TARGET_SELECT_EARLY_REMAT_MODES (sbitmap @var{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 +recomputing values after calls, so that they don't need to be spilled. + +This hook returns the set of such modes by setting the associated bits +in @var{modes}. The default implementation selects no modes, which has +the effect of disabling the early rematerialization pass. +@end deftypefn + @deftypefn {Target Hook} bool TARGET_CLASS_LIKELY_SPILLED_P (reg_class_t @var{rclass}) A target hook which returns @code{true} if pseudos that have been assigned to registers of class @var{rclass} would likely be spilled because @@ -2883,13 +2898,16 @@ as SH, this hook can be used to avoid excessive spilling. @end deftypefn -@deftypefn {Target Hook} bool TARGET_LEGITIMIZE_ADDRESS_DISPLACEMENT (rtx *@var{disp}, rtx *@var{offset}, machine_mode @var{mode}) -A target hook which returns @code{true} if *@var{disp} is -legitimezed to valid address displacement with subtracting *@var{offset} -at memory mode @var{mode}. -The default version of this target hook returns @code{false}. -This hook will benefit machines with limited base plus displacement -addressing. +@deftypefn {Target Hook} bool TARGET_LEGITIMIZE_ADDRESS_DISPLACEMENT (rtx *@var{offset1}, rtx *@var{offset2}, poly_int64 @var{orig_offset}, machine_mode @var{mode}) +This hook tries to split address offset @var{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 +to the anchor to address a value of mode @var{mode}. The idea is that +the local anchor could be shared by other accesses to nearby locations. + +The hook returns true if it succeeds, storing the offset of the +anchor from the base in @var{offset1} and the offset of the final address +from the anchor in @var{offset2}. The default implementation returns false. @end deftypefn @deftypefn {Target Hook} reg_class_t TARGET_SPILL_CLASS (reg_class_t, @var{machine_mode}) @@ -3130,6 +3148,19 @@ the insn and @var{index} is @code{UNSPEC_INDEX} or @code{UNSPECV_INDEX}. @end deftypefn +@deftypefn {Target Hook} {unsigned int} TARGET_DWARF_POLY_INDETERMINATE_VALUE (unsigned int @var{i}, unsigned int *@var{factor}, int *@var{offset}) +Express the value of @code{poly_int} indeterminate @var{i} as a DWARF +expression, with @var{i} counting from 1. Return the number of a DWARF +register @var{R} and set @samp{*@var{factor}} and @samp{*@var{offset}} such +that the value of the indeterminate is: +@smallexample +value_of(@var{R}) / @var{factor} - @var{offset} +@end smallexample + +A target only needs to define this hook if it sets +@samp{NUM_POLY_INT_COEFFS} to a value greater than 1. +@end deftypefn + @defmac INCOMING_FRAME_SP_OFFSET A C expression whose value is an integer giving the offset, in bytes, from the value of the stack pointer register to the top of the stack @@ -3141,6 +3172,15 @@ debugging information like that provided by DWARF 2. @end defmac +@defmac DEFAULT_INCOMING_FRAME_SP_OFFSET +Like @code{INCOMING_FRAME_SP_OFFSET}, but must be the same for all +functions of the same ABI, and when using GAS @code{.cfi_*} directives +must also agree with the default CFI GAS emits. Define this macro +only if @code{INCOMING_FRAME_SP_OFFSET} can have different values +between different functions of the same ABI or when +@code{INCOMING_FRAME_SP_OFFSET} does not agree with GAS default CFI. +@end defmac + @defmac ARG_POINTER_CFA_OFFSET (@var{fundecl}) A C expression whose value is an integer giving the offset, in bytes, from the argument pointer to the canonical frame address (cfa). The @@ -3414,8 +3454,12 @@ normally not need to override that default. @end defmac -@deftypefn {Target Hook} bool TARGET_STACK_CLASH_PROTECTION_FINAL_DYNAMIC_PROBE (rtx @var{residual}) -Some targets make optimistic assumptions about the state of stack probing when they emit their prologues. On such targets a probe into the end of any dynamically allocated space is likely required for safety against stack clash style attacks. Define this variable to return nonzero if such a probe is required or zero otherwise. You need not define this macro if it would always have the value zero. +@deftypefn {Target Hook} HOST_WIDE_INT TARGET_STACK_CLASH_PROTECTION_ALLOCA_PROBE_RANGE (void) +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. +On such targets this value can be set to override the default probing up interval. +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 byesof 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. @end deftypefn @need 2000 @@ -3608,6 +3652,13 @@ @end defmac +@defmac DWARF_LAZY_REGISTER_VALUE (@var{regno}, @var{value}) +Define this macro if the target has pseudo DWARF registers whose +values need to be computed lazily on demand by the unwinder (such as when +referenced in a CFA expression). The macro returns true if @var{regno} +is such a register and stores its value in @samp{*@var{value}} if so. +@end defmac + @node Elimination @subsection Eliminating Frame Pointer and Arg Pointer @@ -3806,7 +3857,7 @@ stack in its natural location. @end defmac -@deftypefn {Target Hook} int TARGET_RETURN_POPS_ARGS (tree @var{fundecl}, tree @var{funtype}, int @var{size}) +@deftypefn {Target Hook} poly_int64 TARGET_RETURN_POPS_ARGS (tree @var{fundecl}, tree @var{funtype}, poly_int64 @var{size}) 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. @@ -4212,6 +4263,14 @@ Define this to return nonzero if the memory reference @var{ref} may alias with the system C library errno location. The default version of this hook assumes the system C library errno location is either a declaration of type int or accessed by dereferencing a pointer to int. @end deftypefn +@deftypefn {Target Hook} machine_mode TARGET_TRANSLATE_MODE_ATTRIBUTE (machine_mode @var{mode}) +Define this hook if during mode attribute processing, the port should +translate machine_mode @var{mode} to another mode. For example, rs6000's +@code{KFmode}, when it is the same as @code{TFmode}. + +The default version of the hook returns that mode that was passed in. +@end deftypefn + @deftypefn {Target Hook} bool TARGET_SCALAR_MODE_SUPPORTED_P (scalar_mode @var{mode}) Define this to return nonzero if the port is prepared to handle insns involving scalar mode @var{mode}. For a scalar mode to be @@ -4230,6 +4289,20 @@ must have move patterns for this mode. @end deftypefn +@deftypefn {Target Hook} opt_machine_mode TARGET_ARRAY_MODE (machine_mode @var{mode}, unsigned HOST_WIDE_INT @var{nelems}) +Return the mode that GCC should use for an array that has +@var{nelems} elements, with each element having mode @var{mode}. +Return no mode if the target has no special requirements. In the +latter case, GCC looks for an integer mode of the appropriate size +if available and uses BLKmode otherwise. Usually the search for the +integer mode is limited to @code{MAX_FIXED_MODE_SIZE}, but the +@code{TARGET_ARRAY_MODE_SUPPORTED_P} hook allows a larger mode to be +used in specific cases. + +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. +@end deftypefn + @deftypefn {Target Hook} bool TARGET_ARRAY_MODE_SUPPORTED_P (machine_mode @var{mode}, unsigned HOST_WIDE_INT @var{nelems}) Return true if GCC should try to use a scalar mode to store an array of @var{nelems} elements, given that each element has mode @var{mode}. @@ -4284,6 +4357,17 @@ if @var{extended} is false, 16 or greater than 128 and a multiple of 32. @end deftypefn +@deftypefn {Target Hook} bool TARGET_FLOATN_BUILTIN_P (int @var{func}) +Define this to return true if the @code{_Float@var{n}} and +@code{_Float@var{n}x} built-in functions should implicitly enable the +built-in function without the @code{__builtin_} prefix in addition to the +normal built-in function with the @code{__builtin_} prefix. The default is +to only enable built-in functions without the @code{__builtin_} prefix for +the GNU C langauge. In strict ANSI/ISO mode, the built-in function without +the @code{__builtin_} prefix is not enabled. The argument @code{FUNC} is the +@code{enum built_in_function} id of the function to be enabled. +@end deftypefn + @deftypefn {Target Hook} bool TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P (machine_mode @var{mode}) 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 @@ -4540,14 +4624,24 @@ nothing when you use @option{-freg-struct-return} mode. @end defmac -@deftypefn {Target Hook} machine_mode TARGET_GET_RAW_RESULT_MODE (int @var{regno}) +@deftypefn {Target Hook} fixed_size_mode TARGET_GET_RAW_RESULT_MODE (int @var{regno}) This target hook returns the mode to be used when accessing raw return registers in @code{__builtin_return}. Define this macro if the value in @var{reg_raw_mode} is not correct. @end deftypefn -@deftypefn {Target Hook} machine_mode TARGET_GET_RAW_ARG_MODE (int @var{regno}) +@deftypefn {Target Hook} fixed_size_mode TARGET_GET_RAW_ARG_MODE (int @var{regno}) This target hook returns the mode to be used when accessing raw argument registers in @code{__builtin_apply_args}. Define this macro if the value in @var{reg_raw_mode} is not correct. @end deftypefn +@deftypefn {Target Hook} bool TARGET_EMPTY_RECORD_P (const_tree @var{type}) +This target hook returns true if the type is an empty record. The default +is to return @code{false}. +@end deftypefn + +@deftypefn {Target Hook} void TARGET_WARN_PARAMETER_PASSING_ABI (cumulative_args_t @var{ca}, tree @var{type}) +This target hook warns about the change in empty class parameter passing +ABI. +@end deftypefn + @node Caller Saves @subsection Caller-Saves Register Allocation @@ -4971,6 +5065,10 @@ Whether this target supports splitting the stack when the options described in @var{opts} have been passed. This is called after options have been parsed, so the target may reject splitting the stack in some configurations. The default version of this hook returns false. If @var{report} is true, this function may issue a warning or error; if @var{report} is false, it must simply return a value @end deftypefn +@deftypefn {Common Target Hook} {vec<const char *>} TARGET_GET_VALID_OPTION_VALUES (int @var{option_code}, const char *@var{prefix}) +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. +@end deftypefn + @node Miscellaneous Register Hooks @subsection Miscellaneous register hooks @cindex miscellaneous register hooks @@ -5174,12 +5272,6 @@ returned by function call into @var{slot}. @end deftypefn -@deftypefn {Target Hook} rtx TARGET_CHKP_FUNCTION_VALUE_BOUNDS (const_tree @var{ret_type}, const_tree @var{fn_decl_or_type}, bool @var{outgoing}) -Define this to return an RTX representing the place where a function -returns bounds for returned pointers. Arguments meaning is similar to -@code{TARGET_FUNCTION_VALUE}. -@end deftypefn - @deftypefn {Target Hook} void TARGET_SETUP_INCOMING_VARARG_BOUNDS (cumulative_args_t @var{args_so_far}, machine_mode @var{mode}, tree @var{type}, int *@var{pretend_args_size}, int @var{second_time}) Use it to store bounds for anonymous register arguments stored into the stack. Arguments meaning is similar to @@ -5187,24 +5279,78 @@ @end deftypefn @node Trampolines -@section Trampolines for Nested Functions +@section Support for Nested Functions +@cindex support for nested functions @cindex trampolines for nested functions -@cindex nested functions, trampolines for - -A @dfn{trampoline} is a small piece of code that is created at run time -when the address of a nested function is taken. It normally resides on -the stack, in the stack frame of the containing function. These macros -tell GCC how to generate code to allocate and initialize a -trampoline. - -The instructions in the trampoline must do two things: load a constant -address into the static chain register, and jump to the real address of -the nested function. On CISC machines such as the m68k, this requires -two instructions, a move immediate and a jump. Then the two addresses -exist in the trampoline as word-long immediate operands. On RISC -machines, it is often necessary to load each address into a register in -two parts. Then pieces of each address form separate immediate -operands. +@cindex descriptors for nested functions +@cindex nested functions, support for + +Taking the address of a nested function requires special compiler +handling to ensure that the static chain register is loaded when +the function is invoked via an indirect call. + +GCC has traditionally supported nested functions by creating an +executable @dfn{trampoline} at run time when the address of a nested +function is taken. This is a small piece of code which normally +resides on the stack, in the stack frame of the containing function. +The trampoline loads the static chain register and then jumps to the +real address of the nested function. + +The use of trampolines requires an executable stack, which is a +security risk. To avoid this problem, GCC also supports another +strategy: using descriptors for nested functions. Under this model, +taking the address of a nested function results in a pointer to a +non-executable function descriptor object. Initializing the static chain +from the descriptor is handled at indirect call sites. + +On some targets, including HPPA and IA-64, function descriptors may be +mandated by the ABI or be otherwise handled in a target-specific way +by the back end in its code generation strategy for indirect calls. +GCC also provides its own generic descriptor implementation to support the +@option{-fno-trampolines} option. In this case runtime detection of +function descriptors at indirect call sites relies on descriptor +pointers being tagged with a bit that is never set in bare function +addresses. Since GCC's generic function descriptors are +not ABI-compliant, this option is typically used only on a +per-language basis (notably by Ada) or when it can otherwise be +applied to the whole program. + +Define the following hook if your backend either implements ABI-specified +descriptor support, or can use GCC's generic descriptor implementation +for nested functions. + +@deftypevr {Target Hook} int 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 +run time. This value gives the number of bytes by which descriptor +pointers are misaligned compared to function pointers. For example, on +targets that require functions to be aligned to a 4-byte boundary, a +value of either 1 or 2 is appropriate unless the architecture already +reserves the bit for another purpose, such as on ARM. + +Define this hook to 0 if the target implements ABI support for +function descriptors in its standard calling sequence, like for example +HPPA or IA-64. + +Using descriptors for nested functions +eliminates the need for trampolines that reside on the stack and require +it to be made executable. +@end deftypevr + +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 +this case the "trampoline" created is the descriptor containing data only. + +The instructions in an executable trampoline must do two things: load +a constant address into the static chain register, and jump to the real +address of the nested function. On CISC machines such as the m68k, +this requires two instructions, a move immediate and a jump. Then the +two addresses exist in the trampoline as word-long immediate operands. +On RISC machines, it is often necessary to load each address into a +register in two parts. Then pieces of each address form separate +immediate operands. The code generated to initialize the trampoline must store the variable parts---the static chain value and the function address---into the @@ -5271,24 +5417,6 @@ If this hook is not defined, @var{addr} will be used for function calls. @end deftypefn -@deftypevr {Target Hook} int TARGET_CUSTOM_FUNCTION_DESCRIPTORS -This hook should be defined to a power of 2 if the target will benefit -from the use of custom descriptors for nested functions instead of the -standard trampolines. Such descriptors are created at run time on the -stack and made up of data only, but they are non-standard so the generated -code must be prepared to deal with them. This hook should be defined to 0 -if the target uses function descriptors for its standard calling sequence, -like for example HP-PA or IA-64. Using descriptors for nested functions -eliminates the need for trampolines that reside on the stack and require -it to be made executable. - -The value of the macro is used to parameterize the run-time identification -scheme implemented to distinguish descriptors from function addresses: it -gives the number of bytes by which their address is misaligned compared -with function addresses. The value of 1 will generally work, unless it is -already reserved by the target for another purpose, like for example on ARM. -@end deftypevr - 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 @@ -5777,8 +5905,24 @@ Return true if vector alignment is reachable (by peeling N iterations) for the given scalar type @var{type}. @var{is_packed} is false if the scalar access using @var{type} is known to be naturally aligned. @end deftypefn -@deftypefn {Target Hook} bool TARGET_VECTORIZE_VEC_PERM_CONST_OK (machine_mode, @var{vec_perm_indices}) -Return true if a vector created for @code{vec_perm_const} is valid. +@deftypefn {Target Hook} bool TARGET_VECTORIZE_VEC_PERM_CONST (machine_mode @var{mode}, rtx @var{output}, rtx @var{in0}, rtx @var{in1}, const vec_perm_indices @var{&sel}) +This hook is used to test whether the target can permute up to two +vectors of mode @var{mode} using the permutation vector @code{sel}, and +also to emit such a permutation. In the former case @var{in0}, @var{in1} +and @var{out} are all null. In the latter case @var{in0} and @var{in1} are +the source vectors and @var{out} is the destination vector; all three are +registers of mode @var{mode}. @var{in1} is the same as @var{in0} if +@var{sel} describes a permutation on one vector instead of two. + +Return true if the operation is possible, emitting instructions for it +if rtxes are provided. + +@cindex @code{vec_perm@var{m}} instruction pattern +If the hook returns false for a mode with multibyte elements, GCC will +try the equivalent byte operation. If that also fails, it will try forcing +the selector into a register and using the @var{vec_perm@var{mode}} +instruction pattern. There is no need for the hook to handle these two +implementation approaches itself. @end deftypefn @deftypefn {Target Hook} tree TARGET_VECTORIZE_BUILTIN_CONVERSION (unsigned @var{code}, tree @var{dest_type}, tree @var{src_type}) @@ -5823,14 +5967,25 @@ transformations even in absence of specialized @acronym{SIMD} hardware. @end deftypefn -@deftypefn {Target Hook} {unsigned int} TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES (void) -This hook should return a mask of sizes that should be iterated over -after trying to autovectorize using the vector size derived from the -mode returned by @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE}. -The default is zero which means to not iterate over other vector sizes. -@end deftypefn - -@deftypefn {Target Hook} opt_machine_mode TARGET_VECTORIZE_GET_MASK_MODE (unsigned @var{nunits}, unsigned @var{length}) +@deftypefn {Target Hook} machine_mode TARGET_VECTORIZE_SPLIT_REDUCTION (machine_mode) +This hook should return the preferred mode to split the final reduction +step on @var{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 @var{mode} which means no splitting. +@end deftypefn + +@deftypefn {Target Hook} void TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES (vector_sizes *@var{sizes}) +If the mode returned by @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE} is not +the only one that is worth considering, this hook should add all suitable +vector sizes to @var{sizes}, in order of decreasing preference. The first +one should be the size of @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE}. + +The hook does not need to do anything if the vector returned by +@code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE} is the only one relevant +for autovectorization. The default implementation does nothing. +@end deftypefn + +@deftypefn {Target Hook} opt_machine_mode TARGET_VECTORIZE_GET_MASK_MODE (poly_uint64 @var{nunits}, poly_uint64 @var{length}) A vector mask is a value that holds one boolean result for every element in a vector. This hook returns the machine mode that should be used to represent such a mask when the vector in question is @var{length} bytes @@ -5842,6 +5997,12 @@ if such a mode exists. @end deftypefn +@deftypefn {Target Hook} bool TARGET_VECTORIZE_EMPTY_MASK_IS_EXPENSIVE (unsigned @var{ifn}) +This hook returns true if masked internal function @var{ifn} (really of +type @code{internal_fn}) should be considered expensive when the mask is +all zeros. GCC can then try to branch around the instruction instead. +@end deftypefn + @deftypefn {Target Hook} {void *} TARGET_VECTORIZE_INIT_COST (struct loop *@var{loop_info}) This hook should initialize target-specific data structures in preparation for modeling the costs of vectorizing a loop or basic block. The default allocates three unsigned integers for accumulating costs for the prologue, body, and epilogue of the loop or basic block. If @var{loop_info} is non-NULL, it identifies the loop being vectorized; otherwise a single block is being vectorized. @end deftypefn @@ -5935,6 +6096,22 @@ for allocating any storage for reductions when necessary. @end deftypefn +@deftypefn {Target Hook} tree TARGET_PREFERRED_ELSE_VALUE (unsigned @var{ifn}, tree @var{type}, unsigned @var{nops}, tree *@var{ops}) +This hook returns the target's preferred final argument for a call +to conditional internal function @var{ifn} (really of type +@code{internal_fn}). @var{type} specifies the return type of the +function and @var{ops} are the operands to the conditional operation, +of which there are @var{nops}. + +For example, if @var{ifn} is @code{IFN_COND_ADD}, the hook returns +a value of type @var{type} that should be used when @samp{@var{ops}[0]} +and @samp{@var{ops}[1]} are conditionally added together. + +This hook is only relevant if the target supports conditional patterns +like @code{cond_add@var{m}}. The default implementation returns a zero +constant of type @var{type}. +@end deftypefn + @node Anchored Addresses @section Anchored Addresses @cindex anchored addresses @@ -6704,6 +6881,12 @@ as the delay slot can hide a pipeline bubble. @end deftypefn +@deftypefn {Target Hook} HOST_WIDE_INT TARGET_ESTIMATED_POLY_VALUE (poly_int64 @var{val}) +Return an estimate of the runtime value of @var{val}, for use in +things like cost calculations or profiling frequencies. The default +implementation returns the lowest possible value of @var{val}. +@end deftypefn + @node Scheduling @section Adjusting the Instruction Scheduler @@ -7374,6 +7557,14 @@ in read-only sections even in executables. @end deftypefn +@deftypefn {Target Hook} bool TARGET_ASM_GENERATE_PIC_ADDR_DIFF_VEC (void) +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 +@end deftypefn + @deftypefn {Target Hook} {section *} TARGET_ASM_SELECT_SECTION (tree @var{exp}, int @var{reloc}, unsigned HOST_WIDE_INT @var{align}) Return the section into which @var{exp} should be placed. You can assume that @var{exp} is either a @code{VAR_DECL} node or a constant of @@ -7699,7 +7890,7 @@ @end defmac @deftypefn {Target Hook} void TARGET_ASM_OUTPUT_SOURCE_FILENAME (FILE *@var{file}, const char *@var{name}) -Output COFF information or DWARF debugging information which indicates that filename @var{name} is the current source file to the stdio stream @var{file}. +Output DWARF debugging information which indicates that filename @var{name} is the current source file to the stdio stream @var{file}. This target hook need not be defined if the standard form of output for the file format in use is appropriate. @end deftypefn @@ -9347,7 +9538,7 @@ function prologue at an offset to the stack pointer that is not aligned to @code{UNITS_PER_WORD}. The definition should be the negative minimum alignment if @code{STACK_GROWS_DOWNWARD} is true, and the positive -minimum alignment otherwise. @xref{SDB and DWARF}. Only applicable if +minimum alignment otherwise. @xref{DWARF}. Only applicable if the target supports DWARF 2 frame unwind information. @end defmac @@ -9417,12 +9608,6 @@ selection in @var{align_jumps} in a @code{JUMP_ALIGN} implementation. @end defmac -@deftypefn {Target Hook} int TARGET_ASM_JUMP_ALIGN_MAX_SKIP (rtx_insn *@var{label}) -The maximum number of bytes to skip before @var{label} when applying -@code{JUMP_ALIGN}. This works only if -@code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined. -@end deftypefn - @defmac LABEL_ALIGN_AFTER_BARRIER (@var{label}) The alignment (log base 2) to put in front of @var{label}, which follows a @code{BARRIER}. @@ -9432,12 +9617,6 @@ define the macro. @end defmac -@deftypefn {Target Hook} int TARGET_ASM_LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP (rtx_insn *@var{label}) -The maximum number of bytes to skip before @var{label} when applying -@code{LABEL_ALIGN_AFTER_BARRIER}. This works only if -@code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined. -@end deftypefn - @defmac LOOP_ALIGN (@var{label}) The alignment (log base 2) to put in front of @var{label} that heads a frequently executed basic block (usually the header of a loop). @@ -9452,12 +9631,6 @@ selection in @code{align_loops} in a @code{LOOP_ALIGN} implementation. @end defmac -@deftypefn {Target Hook} int TARGET_ASM_LOOP_ALIGN_MAX_SKIP (rtx_insn *@var{label}) -The maximum number of bytes to skip when applying @code{LOOP_ALIGN} to -@var{label}. This works only if @code{ASM_OUTPUT_MAX_SKIP_ALIGN} is -defined. -@end deftypefn - @defmac LABEL_ALIGN (@var{label}) The alignment (log base 2) to put in front of @var{label}. If @code{LABEL_ALIGN_AFTER_BARRIER} / @code{LOOP_ALIGN} specify a different alignment, @@ -9469,12 +9642,6 @@ selection in @code{align_labels} in a @code{LABEL_ALIGN} implementation. @end defmac -@deftypefn {Target Hook} int TARGET_ASM_LABEL_ALIGN_MAX_SKIP (rtx_insn *@var{label}) -The maximum number of bytes to skip when applying @code{LABEL_ALIGN} -to @var{label}. This works only if @code{ASM_OUTPUT_MAX_SKIP_ALIGN} -is defined. -@end deftypefn - @defmac ASM_OUTPUT_SKIP (@var{stream}, @var{nbytes}) A C statement to output to the stdio stream @var{stream} an assembler instruction to advance the location counter by @var{nbytes} bytes. @@ -9521,7 +9688,7 @@ * DBX Options:: Macros enabling specific options in DBX format. * DBX Hooks:: Hook macros for varying DBX format. * File Names and DBX:: Macros controlling output of file names in DBX format. -* SDB and DWARF:: Macros for SDB (COFF) and DWARF formats. +* DWARF:: Macros for DWARF format. * VMS Debug:: Macros for VMS debug format. @end menu @@ -9555,9 +9722,8 @@ variable having address @var{x} (an RTL expression). The default computation assumes that @var{x} is based on the frame-pointer and gives the offset from the frame-pointer. This is required for targets -that produce debugging output for DBX or COFF-style debugging output -for SDB and allow the frame-pointer to be eliminated when the -@option{-g} options is used. +that produce debugging output for DBX and allow the frame-pointer to be +eliminated when the @option{-g} option is used. @end defmac @defmac DEBUGGER_ARG_OFFSET (@var{offset}, @var{x}) @@ -9571,8 +9737,8 @@ produce when the user specifies just @option{-g}. Define this if you have arranged for GCC to support more than one format of debugging output. Currently, the allowable values are @code{DBX_DEBUG}, -@code{SDB_DEBUG}, @code{DWARF_DEBUG}, @code{DWARF2_DEBUG}, -@code{XCOFF_DEBUG}, @code{VMS_DEBUG}, and @code{VMS_AND_DWARF2_DEBUG}. +@code{DWARF2_DEBUG}, @code{XCOFF_DEBUG}, @code{VMS_DEBUG}, +and @code{VMS_AND_DWARF2_DEBUG}. When the user specifies @option{-ggdb}, GCC normally also uses the value of this macro to select the debugging output format, but with two @@ -9582,7 +9748,7 @@ The value of this macro only affects the default debugging output; the user can always get a specific type of output by using @option{-gstabs}, -@option{-gcoff}, @option{-gdwarf-2}, @option{-gxcoff}, or @option{-gvms}. +@option{-gdwarf-2}, @option{-gxcoff}, or @option{-gvms}. @end defmac @node DBX Options @@ -9800,16 +9966,11 @@ @end defmac @need 2000 -@node SDB and DWARF -@subsection Macros for SDB and DWARF Output +@node DWARF +@subsection Macros for DWARF Output @c prevent bad page break with this line -Here are macros for SDB and DWARF output. - -@defmac SDB_DEBUGGING_INFO -Define this macro to 1 if GCC should produce COFF-style debugging output -for SDB in response to the @option{-g} option. -@end defmac +Here are macros for DWARF output. @defmac DWARF2_DEBUGGING_INFO Define this macro if GCC should produce dwarf version 2 format @@ -9855,6 +10016,29 @@ tables, and hence is desirable if it works. @end defmac +@defmac DWARF2_ASM_VIEW_DEBUG_INFO +Define this macro to be a nonzero value if the assembler supports view +assignment and verification in @code{.loc}. If it does not, but the +user enables location views, the compiler may have to fallback to +internal line number tables. +@end defmac + +@deftypefn {Target Hook} int TARGET_RESET_LOCATION_VIEW (rtx_insn *@var{}) +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) +cannot be taken for granted. + +If the hook is defined, it must return a positive value to indicate +the insn definitely advances the PC, and so the view number can be +safely assumed to be reset; a negative value to mean the insn +definitely does not advance the PC, and os the view number must not +be reset; or zero to decide based on the estimated insn length. + +If insn length is to be regarded as reliable, set the hook to +@code{hook_int_rtx_insn_0}. +@end deftypefn + @deftypevr {Target Hook} bool TARGET_WANT_DEBUG_PUB_SECTIONS True if the @code{.debug_pubtypes} and @code{.debug_pubnames} sections should be emitted. These sections are not used on most platforms, and in particular GDB does not use them. @end deftypevr @@ -9915,40 +10099,6 @@ reference to the given TLS symbol of the specified size. @end deftypefn -@defmac PUT_SDB_@dots{} -Define these macros to override the assembler syntax for the special -SDB assembler directives. See @file{sdbout.c} for a list of these -macros and their arguments. If the standard syntax is used, you need -not define them yourself. -@end defmac - -@defmac SDB_DELIM -Some assemblers do not support a semicolon as a delimiter, even between -SDB assembler directives. In that case, define this macro to be the -delimiter to use (usually @samp{\n}). It is not necessary to define -a new set of @code{PUT_SDB_@var{op}} macros if this is the only change -required. -@end defmac - -@defmac SDB_ALLOW_UNKNOWN_REFERENCES -Define this macro to allow references to unknown structure, -union, or enumeration tags to be emitted. Standard COFF does not -allow handling of unknown references, MIPS ECOFF has support for -it. -@end defmac - -@defmac SDB_ALLOW_FORWARD_REFERENCES -Define this macro to allow references to structure, union, or -enumeration tags that have not yet been seen to be handled. Some -assemblers choke if forward tags are used, while some require it. -@end defmac - -@defmac SDB_OUTPUT_SOURCE_LINE (@var{stream}, @var{line}) -A C statement to output SDB debugging information before code for line -number @var{line} of the current source file to the stdio stream -@var{stream}. The default is to emit an @code{.ln} directive. -@end defmac - @need 2000 @node VMS Debug @subsection Macros for VMS Debug Format @@ -10689,8 +10839,12 @@ @defmac WORD_REGISTER_OPERATIONS Define this macro to 1 if operations between registers with integral mode -smaller than a word are always performed on the entire register. -Most RISC machines have this property and most CISC machines do not. +smaller than a word are always performed on the entire register. To be +more explicit, if you start with a pair of @code{word_mode} registers with +known values and you do a subword, for example @code{QImode}, addition on +the low part of the registers, then the compiler may consider that the +result has a known value in @code{word_mode} too if the macro is defined +to 1. Most RISC machines have this property and most CISC machines do not. @end defmac @deftypefn {Target Hook} {unsigned int} TARGET_MIN_ARITHMETIC_PRECISION (void) @@ -10814,7 +10968,7 @@ by overriding it. @end deftypefn -@deftypefn {Target Hook} bool TARGET_TRULY_NOOP_TRUNCATION (unsigned int @var{outprec}, unsigned int @var{inprec}) +@deftypefn {Target Hook} bool TARGET_TRULY_NOOP_TRUNCATION (poly_uint64 @var{outprec}, poly_uint64 @var{inprec}) This hook returns true if it is safe to ``convert'' a value of @var{inprec} bits to one of @var{outprec} bits (where @var{outprec} is smaller than @var{inprec}) by merely operating on it as if it had only @@ -10854,6 +11008,19 @@ @code{mode}. @end deftypefn +@deftypefn {Target Hook} bool TARGET_SETJMP_PRESERVES_NONVOLATILE_REGS_P (void) +On some targets, it is assumed that the compiler will spill all pseudos + that are live across a call to @code{setjmp}, while other targets treat + @code{setjmp} calls as normal function calls. + + This hook returns false if @code{setjmp} calls do not preserve all + non-volatile registers so that gcc that must spill all pseudos that are + live across @code{setjmp} calls. Define this to return true if the + target does not need to spill all pseudos live across @code{setjmp} calls. + The default implementation conservatively assumes all pseudos must be + spilled across @code{setjmp} calls. +@end deftypefn + @defmac STORE_FLAG_VALUE A C expression describing the value returned by a comparison operator with an integral mode and stored by a store-flag instruction @@ -11043,11 +11210,10 @@ 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. @end deftypefn -@defmac NO_IMPLICIT_EXTERN_C -Define this macro if the system header files support C++ as well as C@. -This macro inhibits the usual method of using system header files in -C++, which is to pretend that the file's contents are enclosed in -@samp{extern "C" @{@dots{}@}}. +@defmac SYSTEM_IMPLICIT_EXTERN_C +Define this macro if the system header files do not support C++@. +This macro handles system header files by pretending that system +header files are enclosed in @samp{extern "C" @{@dots{}@}}. @end defmac @findex #pragma @@ -11305,93 +11471,6 @@ built-in function. @end deftypefn -@deftypefn {Target Hook} tree TARGET_BUILTIN_CHKP_FUNCTION (unsigned @var{fcode}) -This hook allows target to redefine built-in functions used by -Pointer Bounds Checker for code instrumentation. Hook should return -fndecl of function implementing generic builtin whose code is -passed in @var{fcode}. Currently following built-in functions are -obtained using this hook: -@deftypefn {Built-in Function} __bounds_type __chkp_bndmk (const void *@var{lb}, size_t @var{size}) -Function code - BUILT_IN_CHKP_BNDMK. This built-in function is used -by Pointer Bounds Checker to create bound values. @var{lb} holds low -bound of the resulting bounds. @var{size} holds size of created bounds. -@end deftypefn - -@deftypefn {Built-in Function} void __chkp_bndstx (const void *@var{ptr}, __bounds_type @var{b}, const void **@var{loc}) -Function code - @code{BUILT_IN_CHKP_BNDSTX}. This built-in function is used -by Pointer Bounds Checker to store bounds @var{b} for pointer @var{ptr} -when @var{ptr} is stored by address @var{loc}. -@end deftypefn - -@deftypefn {Built-in Function} __bounds_type __chkp_bndldx (const void **@var{loc}, const void *@var{ptr}) -Function code - @code{BUILT_IN_CHKP_BNDLDX}. This built-in function is used -by Pointer Bounds Checker to get bounds of pointer @var{ptr} loaded by -address @var{loc}. -@end deftypefn - -@deftypefn {Built-in Function} void __chkp_bndcl (const void *@var{ptr}, __bounds_type @var{b}) -Function code - @code{BUILT_IN_CHKP_BNDCL}. This built-in function is used -by Pointer Bounds Checker to perform check for pointer @var{ptr} against -lower bound of bounds @var{b}. -@end deftypefn - -@deftypefn {Built-in Function} void __chkp_bndcu (const void *@var{ptr}, __bounds_type @var{b}) -Function code - @code{BUILT_IN_CHKP_BNDCU}. This built-in function is used -by Pointer Bounds Checker to perform check for pointer @var{ptr} against -upper bound of bounds @var{b}. -@end deftypefn - -@deftypefn {Built-in Function} __bounds_type __chkp_bndret (void *@var{ptr}) -Function code - @code{BUILT_IN_CHKP_BNDRET}. This built-in function is used -by Pointer Bounds Checker to obtain bounds returned by a call statement. -@var{ptr} passed to built-in is @code{SSA_NAME} returned by the call. -@end deftypefn - -@deftypefn {Built-in Function} __bounds_type __chkp_intersect (__bounds_type @var{b1}, __bounds_type @var{b2}) -Function code - @code{BUILT_IN_CHKP_INTERSECT}. This built-in function -returns intersection of bounds @var{b1} and @var{b2}. -@end deftypefn - -@deftypefn {Built-in Function} __bounds_type __chkp_narrow (const void *@var{ptr}, __bounds_type @var{b}, size_t @var{s}) -Function code - @code{BUILT_IN_CHKP_NARROW}. This built-in function -returns intersection of bounds @var{b} and -[@var{ptr}, @var{ptr} + @var{s} - @code{1}]. -@end deftypefn - -@deftypefn {Built-in Function} size_t __chkp_sizeof (const void *@var{ptr}) -Function code - @code{BUILT_IN_CHKP_SIZEOF}. This built-in function -returns size of object referenced by @var{ptr}. @var{ptr} is always -@code{ADDR_EXPR} of @code{VAR_DECL}. This built-in is used by -Pointer Bounds Checker when bounds of object cannot be computed statically -(e.g. object has incomplete type). -@end deftypefn - -@deftypefn {Built-in Function} const void *__chkp_extract_lower (__bounds_type @var{b}) -Function code - @code{BUILT_IN_CHKP_EXTRACT_LOWER}. This built-in function -returns lower bound of bounds @var{b}. -@end deftypefn - -@deftypefn {Built-in Function} const void *__chkp_extract_upper (__bounds_type @var{b}) -Function code - @code{BUILT_IN_CHKP_EXTRACT_UPPER}. This built-in function -returns upper bound of bounds @var{b}. -@end deftypefn -@end deftypefn -@deftypefn {Target Hook} tree TARGET_CHKP_BOUND_TYPE (void) -Return type to be used for bounds -@end deftypefn -@deftypefn {Target Hook} machine_mode TARGET_CHKP_BOUND_MODE (void) -Return mode to be used for bounds. -@end deftypefn -@deftypefn {Target Hook} tree TARGET_CHKP_MAKE_BOUNDS_CONSTANT (HOST_WIDE_INT @var{lb}, HOST_WIDE_INT @var{ub}) -Return constant used to statically initialize constant bounds -with specified lower bound @var{lb} and upper bounds @var{ub}. -@end deftypefn -@deftypefn {Target Hook} int TARGET_CHKP_INITIALIZE_BOUNDS (tree @var{var}, tree @var{lb}, tree @var{ub}, tree *@var{stmts}) -Generate a list of statements @var{stmts} to initialize pointer -bounds variable @var{var} with bounds @var{lb} and @var{ub}. Return -the number of generated statements. -@end deftypefn - @deftypefn {Target Hook} tree TARGET_RESOLVE_OVERLOADED_BUILTIN (unsigned int @var{loc}, tree @var{fndecl}, void *@var{arglist}) Select a replacement for a machine specific built-in function that was set up by @samp{TARGET_INIT_BUILTINS}. This is done @@ -11906,6 +11985,42 @@ @end defmac +@deftypefn {Target Hook} bool TARGET_HAVE_SPECULATION_SAFE_VALUE (bool @var{active}) +This hook is used to determine the level of target support for + @code{__builtin_speculation_safe_value}. If called with an argument + of false, it returns true if the target has been modified to support + this builtin. If called with an argument of true, it returns true + if the target requires active mitigation execution might be speculative. + + The default implementation returns false if the target does not define + a pattern named @code{speculation_barrier}. Else it returns true + for the first case and whether the pattern is enabled for the current + compilation for the second case. + + For targets that have no processors that can execute instructions + speculatively an alternative implemenation of this hook is available: + simply redefine this hook to @code{speculation_safe_value_not_needed} + along with your other target hooks. +@end deftypefn + +@deftypefn {Target Hook} rtx TARGET_SPECULATION_SAFE_VALUE (machine_mode @var{mode}, rtx @var{result}, rtx @var{val}, rtx @var{failval}) +This target hook can be used to generate a target-specific code + sequence that implements the @code{__builtin_speculation_safe_value} + built-in function. The function must always return @var{val} in + @var{result} in mode @var{mode} when the cpu is not executing + speculatively, but must never return that when speculating until it + is known that the speculation will not be unwound. The hook supports + two primary mechanisms for implementing the requirements. The first + is to emit a speculation barrier which forces the processor to wait + until all prior speculative operations have been resolved; the second + is to use a target-specific mechanism that can track the speculation + state and to return @var{failval} if it can determine that + speculation must be unwound at a later time. + + The default implementation simply copies @var{val} to @var{result} and + emits a @code{speculation_barrier} instruction if that is defined. +@end deftypefn + @deftypefn {Target Hook} void TARGET_RUN_TARGET_SELFTESTS (void) If selftests are enabled, run any selftests for this target. @end deftypefn