@code{STACK_BOUNDARY}.
@end defmac
-@defmac FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN
-A C expression that evaluates true if @code{PREFERRED_STACK_BOUNDARY} is
-not guaranteed by the runtime and we should emit code to align the stack
-at the beginning of @code{main}.
-
-@cindex @code{PUSH_ROUNDING}, interaction with @code{PREFERRED_STACK_BOUNDARY}
-If @code{PUSH_ROUNDING} is not defined, the stack will always be aligned
-to the specified boundary. If @code{PUSH_ROUNDING} is defined and specifies
-a less strict alignment than @code{PREFERRED_STACK_BOUNDARY}, the stack may
-be momentarily unaligned while pushing arguments.
-@end defmac
-
@defmac FUNCTION_BOUNDARY
Alignment required for a function entry point, in bits.
@end defmac
may affect its placement.
@end deftypefn
+@deftypefn {Target Hook} {bool} TARGET_DECIMAL_FLOAT_SUPPORTED_P (void)
+Returns true if the target supports decimal floating point.
+@end deftypefn
+
@deftypefn {Target Hook} {const char *} TARGET_MANGLE_FUNDAMENTAL_TYPE (tree @var{type})
If your target defines any fundamental types, define this hook to
return the appropriate encoding for these types as part of a C++
@end defmac
@defmac LIBGCC2_HAS_DF_MODE
-Define this macro if neither @code{LIBGCC2_DOUBLE_TYPE_SIZE} nor
+Define this macro if neither @code{LIBGCC2_DOUBLE_TYPE_SIZE} nor
@code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE} is
@code{DFmode} but you want @code{DFmode} routines in @file{libgcc2.a}
anyway. If you don't define this and either @code{LIBGCC2_DOUBLE_TYPE_SIZE}
@end defmac
@defmac LIBGCC2_HAS_XF_MODE
-Define this macro if @code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE} is not
+Define this macro if @code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE} is not
@code{XFmode} but you want @code{XFmode} routines in @file{libgcc2.a}
anyway. If you don't define this and @code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE}
is 80 then the default is 1, otherwise it is 0.
@end defmac
@defmac LIBGCC2_HAS_TF_MODE
-Define this macro if @code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE} is not
+Define this macro if @code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE} is not
@code{TFmode} but you want @code{TFmode} routines in @file{libgcc2.a}
anyway. If you don't define this and @code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE}
is 128 then the default is 1, otherwise it is 0.
@end defmac
+@defmac SF_SIZE
+@defmacx DF_SIZE
+@defmacx XF_SIZE
+@defmacx TF_SIZE
+Define these macros to be the size in bits of the mantissa of
+@code{SFmode}, @code{DFmode}, @code{XFmode} and @code{TFmode} values,
+if the defaults in @file{libgcc2.h} are inappropriate. By default,
+@code{FLT_MANT_DIG} is used for @code{SF_SIZE}, @code{LDBL_MANT_DIG}
+for @code{XF_SIZE} and @code{TF_SIZE}, and @code{DBL_MANT_DIG} or
+@code{LDBL_MANT_DIG} for @code{DF_SIZE} according to whether
+@code{LIBGCC2_DOUBLE_TYPE_SIZE} or
+@code{LIBGCC2_LONG_DOUBLE_TYPE_SIZE} is 64.
+@end defmac
+
@defmac TARGET_FLT_EVAL_METHOD
A C expression for the value for @code{FLT_EVAL_METHOD} in @file{float.h},
assuming, if applicable, that the floating-point control word is in its
require the macro to do something nontrivial.
@end defmac
-@defmac SECONDARY_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
-@defmacx SECONDARY_INPUT_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
-@defmacx SECONDARY_OUTPUT_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
+@deftypefn {Target Hook} enum reg_class TARGET_SECONDARY_RELOAD (bool @var{in_p}, rtx @var{x}, enum reg_class @var{reload_class}, enum machine_mode @var{reload_mode}, secondary_reload_info *@var{sri})
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
-from general registers, but not memory. Some machines allow copying all
-registers to and from memory, but require a scratch register for stores
-to some memory locations (e.g., those with symbolic address on the RT,
-and those with certain symbolic address on the SPARC when compiling
-PIC)@. In some cases, both an intermediate and a scratch register are
-required.
+from general registers, but not memory. Below, we shall be using the
+term 'intermediate register' when a move operation cannot be performed
+directly, but has to be done by copying the source into the intermediate
+register first, and then copying the intermediate register to the
+destination. An intermediate register always has the same mode as
+source and destination. Since it holds the actual value being copied,
+reload might apply optimizations to re-use an intermediate register
+and eliding the copy from the source when it can determine that the
+intermediate register still holds the required value.
+
+Another kind of secondary reload is required on some machines which
+allow copying all registers to and from memory, but require a scratch
+register for stores to some memory locations (e.g., those with symbolic
+address on the RT, and those with certain symbolic address on the SPARC
+when compiling PIC)@. Scratch registers need not have the same mode
+as the value being copied, and usually hold a different value that
+that being copied. Special patterns in the md file are needed to
+describe how the copy is performed with the help of the scratch register;
+these patterns also describe the number, register class(es) and mode(s)
+of the scratch register(s).
+
+In some cases, both an intermediate and a scratch register are required.
+
+For input reloads, this target hook is called with nonzero @var{in_p},
+and @var{x} is an rtx that needs to be copied to a register in of class
+@var{reload_class} in @var{reload_mode}. For output reloads, this target
+hook is called with zero @var{in_p}, and a register of class @var{reload_mode}
+needs to be copied to rtx @var{x} in @var{reload_mode}.
+
+If copying a register of @var{reload_class} from/to @var{x} requires
+an intermediate register, the hook @code{secondary_reload} should
+return the register class required for this intermediate register.
+If no intermediate register is required, it should return NO_REGS.
+If more than one intermediate register is required, describe the one
+that is closest in the copy chain to the reload register.
+
+If scratch registers are needed, you also have to describe how to
+perform the copy from/to the reload register to/from this
+closest intermediate register. Or if no intermediate register is
+required, but still a scratch register is needed, describe the
+copy from/to the reload register to/from the reload operand @var{x}.
+
+You do this by setting @code{sri->icode} to the instruction code of a pattern
+in the md file which performs the move. Operands 0 and 1 are the output
+and input of this copy, respectively. Operands from operand 2 onward are
+for scratch operands. These scratch operands must have a mode, and a
+single-register-class
+@c [later: or memory]
+output constraint.
+
+When an intermediate register is used, the @code{secondary_reload}
+hook will be called again to determine how to copy the intermediate
+register to/from the reload operand @var{x}, so your hook must also
+have code to handle the register class of the intermediate operand.
+
+@c [For later: maybe we'll allow multi-alternative reload patterns -
+@c the port maintainer could name a mov<mode> pattern that has clobbers -
+@c and match the constraints of input and output to determine the required
+@c alternative. A restriction would be that constraints used to match
+@c against reloads registers would have to be written as register class
+@c constraints, or we need a new target macro / hook that tells us if an
+@c arbitrary constraint can match an unknown register of a given class.
+@c Such a macro / hook would also be useful in other places.]
+
+
+@var{x} might be a pseudo-register or a @code{subreg} of a
+pseudo-register, which could either be in a hard register or in memory.
+Use @code{true_regnum} to find out; it will return @minus{}1 if the pseudo is
+in memory and the hard register number if it is in a register.
+
+Scratch operands in memory (constraint @code{"=m"} / @code{"=&m"}) are
+currently not supported. For the time being, you will have to continue
+to use @code{SECONDARY_MEMORY_NEEDED} for that purpose.
+
+@code{copy_cost} also uses this target hook to find out how values are
+copied. If you want it to include some extra cost for the need to allocate
+(a) scratch register(s), set @code{sri->extra_cost} to the additional cost.
+Or if two dependent moves are supposed to have a lower cost than the sum
+of the individual moves due to expected fortuitous scheduling and/or special
+forwarding logic, you can set @code{sri->extra_cost} to a negative amount.
+@end deftypefn
+
+@defmac SECONDARY_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
+@defmacx SECONDARY_INPUT_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
+@defmacx SECONDARY_OUTPUT_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
+These macros are obsolete, new ports should use the target hook
+@code{TARGET_SECONDARY_RELOAD} instead.
-You should define these macros to indicate to the reload phase that it may
+These are obsolete macros, replaced by the @code{TARGET_SECONDARY_RELOAD}
+target hook. Older ports still define these macros to indicate to the
+reload phase that it may
need to allocate at least one register for a reload in addition to the
register to contain the data. Specifically, if copying @var{x} to a
register @var{class} in @var{mode} requires an intermediate register,
-you should define @code{SECONDARY_INPUT_RELOAD_CLASS} to return the
+you were supposed to define @code{SECONDARY_INPUT_RELOAD_CLASS} to return the
largest register class all of whose registers can be used as
intermediate registers or scratch registers.
If copying a register @var{class} in @var{mode} to @var{x} requires an
intermediate or scratch register, @code{SECONDARY_OUTPUT_RELOAD_CLASS}
-should be defined to return the largest register class required. If the
-requirements for input and output reloads are the same, the macro
-@code{SECONDARY_RELOAD_CLASS} should be used instead of defining both
+was supposed to be defined be defined to return the largest register
+class required. If the
+requirements for input and output reloads were the same, the macro
+@code{SECONDARY_RELOAD_CLASS} should have been used instead of defining both
macros identically.
The values returned by these macros are often @code{GENERAL_REGS}.
macro if it would always return @code{NO_REGS}.
If a scratch register is required (either with or without an
-intermediate register), you should define patterns for
+intermediate register), you were supposed to define patterns for
@samp{reload_in@var{m}} or @samp{reload_out@var{m}}, as required
-(@pxref{Standard Names}. These patterns, which will normally be
+(@pxref{Standard Names}. These patterns, which were normally
implemented with a @code{define_expand}, should be similar to the
@samp{mov@var{m}} patterns, except that operand 2 is the scratch
register.
-Define constraints for the reload register and scratch register that
+These patterns need constraints for the reload register and scratch
+register that
contain a single register class. If the original reload register (whose
class is @var{class}) can meet the constraint given in the pattern, the
value returned by these macros is used for the class of the scratch
* Function Entry::
* Profiling::
* Tail Calls::
+* Stack Smashing Protection::
@end menu
@node Frame Layout
@end defmac
@defmac FRAME_GROWS_DOWNWARD
-Define this macro if the addresses of local variable slots are at negative
-offsets from the frame pointer.
+Define this macro to nonzero value if the addresses of local variable slots
+are at negative offsets from the frame pointer.
@end defmac
@defmac ARGS_GROW_DOWNWARD
@defmac INITIAL_FRAME_ADDRESS_RTX
A C expression whose value is RTL representing the address of the initial
- stack frame. This address is passed to @code{RETURN_ADDR_RTX} and
-@code{DYNAMIC_CHAIN_ADDRESS}.
-If you don't define this macro, the default is to return
-@code{hard_frame_pointer_rtx}.
-This default is usually correct unless @code{-fomit-frame-pointer} is in
-effect.
-Define this macro in order to make @code{__builtin_frame_address (0)} and
-@code{__builtin_return_address (0)} work even in absence of a hard frame pointer.
+stack frame. This address is passed to @code{RETURN_ADDR_RTX} and
+@code{DYNAMIC_CHAIN_ADDRESS}. If you don't define this macro, a reasonable
+default value will be used. Define this macro in order to make frame pointer
+elimination work in the presence of @code{__builtin_frame_address (count)} and
+@code{__builtin_return_address (count)} for @code{count} not equal to zero.
@end defmac
@defmac DYNAMIC_CHAIN_ADDRESS (@var{frameaddr})
DWARF 2.
@end defmac
+@defmac FRAME_POINTER_CFA_OFFSET (@var{fundecl})
+If defined, a C expression whose value is an integer giving the offset
+in bytes from the frame pointer to the canonical frame address (cfa).
+The final value should conincide with that calculated by
+@code{INCOMING_FRAME_SP_OFFSET}.
+
+Normally the CFA is calculated as an offset from the argument pointer,
+via @code{ARG_POINTER_CFA_OFFSET}, but if the argument pointer is
+variable due to the ABI, this may not be possible. If this macro is
+defined, it implies that the virtual register instantiation should be
+based on the frame pointer instead of the argument pointer. Only one
+of @code{FRAME_POINTER_CFA_OFFSET} and @code{ARG_POINTER_CFA_OFFSET}
+should be defined.
+@end defmac
+
@node Exception Handling
@subsection Exception Handling Support
@cindex exception handling
may vary greatly between different architectures.
@end deftypefn
+@deftypefn {Target Hook} void TARGET_EXTRA_LIVE_ON_ENTRY (bitmap *@var{regs})
+Add any hard registers to @var{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
+registers, STATIC_CHAIN_INCOMING_REGNUM, STATIC_CHAIN_REGNUM,
+TARGET_STRUCT_VALUE_RTX, FRAME_POINTER_REGNUM, EH_USES,
+FRAME_POINTER_REGNUM, ARG_POINTER_REGNUM, and the PIC_OFFSET_TABLE_REGNUM.
+@end deftypefn
+
+@node Stack Smashing Protection
+@subsection Stack smashing protection
+@cindex stack smashing protection
+
+@deftypefn {Target Hook} tree TARGET_STACK_PROTECT_GUARD (void)
+This hook returns a @code{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
+that is placed at the top of the local stack frame. The type of this
+variable must be @code{ptr_type_node}.
+
+The default version of this hook creates a variable called
+@samp{__stack_chk_guard}, which is normally defined in @file{libgcc2.c}.
+@end deftypefn
+
+@deftypefn {Target Hook} tree TARGET_STACK_PROTECT_FAIL (void)
+This hook returns a tree expression that alerts the runtime that the
+stack protect guard variable has been modified. This expression should
+involve a call to a @code{noreturn} function.
+
+The default version of this hook invokes a function called
+@samp{__stack_chk_fail}, taking no arguments. This function is
+normally defined in @file{libgcc2.c}.
+@end deftypefn
+
@node Varargs
@section Implementing the Varargs Macros
@cindex varargs implementation
@end defmac
@defmac TRAMPOLINE_SECTION
-The name of a subroutine to switch to the section in which the
-trampoline template is to be placed (@pxref{Sections}). The default is
-a value of @samp{readonly_data_section}, which places the trampoline in
-the section containing read-only data.
+Return the section into which the trampoline template is to be placed
+(@pxref{Sections}). The default value is @code{readonly_data_section}.
@end defmac
@defmac TRAMPOLINE_SIZE
@deftypefn {Target Hook} tree TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD (void)
This hook should return the DECL of a function @var{f} that given an
address @var{addr} as an argument returns a mask @var{m} that can be
-used to extract from two vectors the relevant data that resides in
+used to extract from two vectors the relevant data that resides in
@var{addr} in case @var{addr} is not properly aligned.
The autovectrizer, when vectorizing a load operation from an address
@var{v1} and @var{v2}, are the two vectors, each of size @var{VS}, and
the third argument, @var{OFF}, defines how the data will be extracted
from these two vectors: if @var{OFF} is 0, then the returned vector is
-@var{v2}; otherwise, the returned vector is composed from the last
-@var{VS}-@var{OFF} elements of @var{v1} concatenated to the first
+@var{v2}; otherwise, the returned vector is composed from the last
+@var{VS}-@var{OFF} elements of @var{v1} concatenated to the first
@var{OFF} elements of @var{v2}.
If this hook is defined, the autovectorizer will generate a call
to @var{f} (using the DECL tree that this hook returns) and will
use the return value of @var{f} as the argument @var{OFF} to
@code{REALIGN_LOAD}. Therefore, the mask @var{m} returned by @var{f}
-should comply with the semantics expected by @code{REALIGN_LOAD}
+should comply with the semantics expected by @code{REALIGN_LOAD}
described above.
If this hook is not defined, then @var{addr} will be used as
the argument @var{OFF} to @code{REALIGN_LOAD}, in which case the low
This value must be constant over the entire compilation. If you need
it to vary depending on what the instructions are, you must use
@samp{TARGET_SCHED_VARIABLE_ISSUE}.
-
-You could define this hook to return the value of the macro
-@code{MAX_DFA_ISSUE_RATE}.
@end deftypefn
@deftypefn {Target Hook} int TARGET_SCHED_VARIABLE_ISSUE (FILE *@var{file}, int @var{verbose}, rtx @var{insn}, int @var{more})
not in cases of "costly dependences", which this hooks allows to define.
@end deftypefn
-Macros in the following table are generated by the program
-@file{genattr} and can be useful for writing the hooks.
-
-@defmac MAX_DFA_ISSUE_RATE
-The macro definition is generated in the automaton based pipeline
-description interface. Its value is calculated from the automaton
-based pipeline description and is equal to maximal number of all insns
-described in constructions @samp{define_insn_reservation} which can be
-issued on the same processor cycle.
-@end defmac
-
@node Sections
@section Dividing the Output into Sections (Texts, Data, @dots{})
@c the above section title is WAY too long. maybe cut the part between
section}, which holds uninitialized data. Some systems have other kinds
of sections.
-The compiler must tell the assembler when to switch sections. These
-macros control what commands to output to tell the assembler this. You
-can also define additional sections.
+@file{varasm.c} provides several well-known sections, such as
+@code{text_section}, @code{data_section} and @code{bss_section}.
+The normal way of controlling a @code{@var{foo}_section} variable
+is to define the associated @code{@var{FOO}_SECTION_ASM_OP} macro,
+as described below. The macros are only read once, when @file{varasm.c}
+initializes itself, so their values must be run-time constants.
+They may however depend on command-line flags.
+
+@emph{Note:} Some run-time files, such @file{crtstuff.c}, also make
+use of the @code{@var{FOO}_SECTION_ASM_OP} macros, and expect them
+to be string literals.
+
+Some assemblers require a different string to be written every time a
+section is selected. If your assembler falls into this category, you
+should define the @code{TARGET_ASM_INIT_SECTIONS} hook and use
+@code{get_unnamed_section} to set up the sections.
+
+You must always create a @code{text_section}, either by defining
+@code{TEXT_SECTION_ASM_OP} or by initializing @code{text_section}
+in @code{TARGET_ASM_INIT_SECTIONS}. The same is true of
+@code{data_section} and @code{DATA_SECTION_ASM_OP}. If you do not
+create a distinct @code{readonly_data_section}, the default is to
+reuse @code{text_section}.
+
+All the other @file{varasm.c} sections are optional, and are null
+if the target does not provide them.
@defmac TEXT_SECTION_ASM_OP
A C expression whose value is a string, including spacing, containing the
data. Normally @code{"\t.data"} is right.
@end defmac
+@defmac SDATA_SECTION_ASM_OP
+If defined, a C expression whose value is a string, including spacing,
+containing the assembler operation to identify the following data as
+initialized, writable small data.
+@end defmac
+
@defmac READONLY_DATA_SECTION_ASM_OP
A C expression whose value is a string, including spacing, containing the
assembler operation to identify the following data as read-only initialized
data.
@end defmac
-@defmac READONLY_DATA_SECTION
-A macro naming a function to call to switch to the proper section for
-read-only data. The default is to use @code{READONLY_DATA_SECTION_ASM_OP}
-if defined, else fall back to @code{text_section}.
-
-The most common definition will be @code{data_section}, if the target
-does not have a special read-only data section, and does not put data
-in the text section.
-@end defmac
-
@defmac BSS_SECTION_ASM_OP
If defined, a C expression whose value is a string, including spacing,
containing the assembler operation to identify the following data as
used.
@end defmac
+@defmac SBSS_SECTION_ASM_OP
+If defined, a C expression whose value is a string, including spacing,
+containing the assembler operation to identify the following data as
+uninitialized, writable small data.
+@end defmac
+
@defmac INIT_SECTION_ASM_OP
If defined, a C expression whose value is a string, including spacing,
containing the assembler operation to identify the following data as
initialization code. If not defined, GCC will assume such a section does
-not exist.
+not exist. This section has no corresponding @code{init_section}
+variable; it is used entirely in runtime code.
@end defmac
@defmac FINI_SECTION_ASM_OP
If defined, a C expression whose value is a string, including spacing,
containing the assembler operation to identify the following data as
finalization code. If not defined, GCC will assume such a section does
-not exist.
+not exist. This section has no corresponding @code{fini_section}
+variable; it is used entirely in runtime code.
@end defmac
@defmac INIT_ARRAY_SECTION_ASM_OP
defined, GCC will assume such a section does not exist. Do not define
both this macro and @code{INIT_SECTION_ASM_OP}.
@end defmac
-
+
@defmac FINI_ARRAY_SECTION_ASM_OP
If defined, a C expression whose value is a string, including spacing,
containing the assembler operation to identify the following data as
and thus prevent the linker from having to add any padding.
@end defmac
-@findex in_text
-@findex in_data
-@defmac EXTRA_SECTIONS
-A list of names for sections other than the standard two, which are
-@code{in_text} and @code{in_data}. You need not define this macro
-on a system with no other sections (that GCC needs to use).
-@end defmac
-
-@findex text_section
-@findex data_section
-@defmac EXTRA_SECTION_FUNCTIONS
-One or more functions to be defined in @file{varasm.c}. These
-functions should do jobs analogous to those of @code{text_section} and
-@code{data_section}, for your additional sections. Do not define this
-macro if you do not define @code{EXTRA_SECTIONS}.
-@end defmac
-
@defmac JUMP_TABLES_IN_TEXT_SECTION
Define this macro to be an expression with a nonzero value if jump
tables (for @code{tablejump} insns) should be output in the text
This macro is irrelevant if there is no separate readonly data section.
@end defmac
-@deftypefn {Target Hook} void TARGET_ASM_SELECT_SECTION (tree @var{exp}, int @var{reloc}, unsigned HOST_WIDE_INT @var{align})
-Switches to the appropriate section for output of @var{exp}. You can
+@deftypefn {Target Hook} void TARGET_ASM_INIT_SECTIONS (void)
+Define this hook if you need to do something special to set up the
+@file{varasm.c} sections, or if your target has some special sections
+of its own that you need to create.
+
+GCC calls this hook after processing the command line, but before writing
+any assembly code, and before calling any of the section-returning hooks
+described below.
+@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
some sort. @var{reloc} indicates whether the initial value of @var{exp}
requires link-time relocations. Bit 0 is set when variable contains
local relocations only, while bit 1 is set for global relocations.
-Select the section by calling @code{data_section} or one of the
-alternatives for other sections. @var{align} is the constant alignment
-in bits.
+@var{align} is the constant alignment in bits.
The default version of this function takes care of putting read-only
variables in @code{readonly_data_section}.
Whatever the actual target object format, this is often good enough.
@end deftypefn
-@deftypefn {Target Hook} void TARGET_ASM_FUNCTION_RODATA_SECTION (tree @var{decl})
-Switches to a readonly data section associated with
+@deftypefn {Target Hook} {section *} TARGET_ASM_FUNCTION_RODATA_SECTION (tree @var{decl})
+Return the readonly data section associated with
@samp{DECL_SECTION_NAME (@var{decl})}.
-The default version of this function switches to @code{.gnu.linkonce.r.name}
-section if function's section is @code{.gnu.linkonce.t.name}, to
-@code{.rodata.name} if function is in @code{.text.name} section
-and otherwise switches to the normal readonly data section.
+The default version of this function selects @code{.gnu.linkonce.r.name} if
+the function's section is @code{.gnu.linkonce.t.name}, @code{.rodata.name}
+if function is in @code{.text.name}, and the normal readonly-data section
+otherwise.
@end deftypefn
-@deftypefn {Target Hook} void TARGET_ASM_SELECT_RTX_SECTION (enum machine_mode @var{mode}, rtx @var{x}, unsigned HOST_WIDE_INT @var{align})
-Switches to the appropriate section for output of constant pool entry
-@var{x} in @var{mode}. You can assume that @var{x} is some kind of
+@deftypefn {Target Hook} {section *} TARGET_ASM_SELECT_RTX_SECTION (enum machine_mode @var{mode}, rtx @var{x}, unsigned HOST_WIDE_INT @var{align})
+Return the section into which a constant @var{x}, of mode @var{mode},
+should be placed. You can assume that @var{x} is some kind of
constant in RTL@. The argument @var{mode} is redundant except in the
-case of a @code{const_int} rtx. Select the section by calling
-@code{readonly_data_section} or one of the alternatives for other
-sections. @var{align} is the constant alignment in bits.
+case of a @code{const_int} rtx. @var{align} is the constant alignment
+in bits.
The default version of this function takes care of putting symbolic
constants in @code{flag_pic} mode in @code{data_section} and everything
this macro if @code{PIC_OFFSET_TABLE_REGNUM} is not defined.
@end defmac
-@defmac FINALIZE_PIC
-By generating position-independent code, when two different programs (A
-and B) share a common library (libC.a), the text of the library can be
-shared whether or not the library is linked at the same address for both
-programs. In some of these environments, position-independent code
-requires not only the use of different addressing modes, but also
-special code to enable the use of these addressing modes.
-
-The @code{FINALIZE_PIC} macro serves as a hook to emit these special
-codes once the function is being compiled into assembly code, but not
-before. (It is not done before, because in the case of compiling an
-inline function, it would lead to multiple PIC prologues being
-included in functions which used inline functions and were compiled to
-assembly language.)
-@end defmac
-
@defmac LEGITIMATE_PIC_OPERAND_P (@var{x})
A C expression that is nonzero if @var{x} is a legitimate immediate
operand on the target machine when generating position independent code.
@defmac REAL_VALUE_TO_TARGET_SINGLE (@var{x}, @var{l})
@defmacx REAL_VALUE_TO_TARGET_DOUBLE (@var{x}, @var{l})
@defmacx REAL_VALUE_TO_TARGET_LONG_DOUBLE (@var{x}, @var{l})
-These translate @var{x}, of type @code{REAL_VALUE_TYPE}, to the target's
-floating point representation, and store its bit pattern in the variable
-@var{l}. For @code{REAL_VALUE_TO_TARGET_SINGLE}, this variable should
-be a simple @code{long int}. For the others, it should be an array of
-@code{long int}. The number of elements in this array is determined by
-the size of the desired target floating point data type: 32 bits of it
-go in each @code{long int} array element. Each array element holds 32
-bits of the result, even if @code{long int} is wider than 32 bits on the
-host machine.
+@defmacx REAL_VALUE_TO_TARGET_DECIMAL32 (@var{x}, @var{l})
+@defmacx REAL_VALUE_TO_TARGET_DECIMAL64 (@var{x}, @var{l})
+@defmacx REAL_VALUE_TO_TARGET_DECIMAL128 (@var{x}, @var{l})
+These translate @var{x}, of type @code{REAL_VALUE_TYPE}, to the
+target's floating point representation, and store its bit pattern in
+the variable @var{l}. For @code{REAL_VALUE_TO_TARGET_SINGLE} and
+@code{REAL_VALUE_TO_TARGET_DECIMAL32}, this variable should be a
+simple @code{long int}. For the others, it should be an array of
+@code{long int}. The number of elements in this array is determined
+by the size of the desired target floating point data type: 32 bits of
+it go in each @code{long int} array element. Each array element holds
+32 bits of the result, even if @code{long int} is wider than 32 bits
+on the host machine.
The array element values are designed so that you can print them out
using @code{fprintf} in the order they should appear in the target
@findex assemble_name_raw
@defmac ASM_OUTPUT_INTERNAL_LABEL (@var{stream}, @var{name})
-Identical to @code{ASM_OUTPUT_lABEL}, except that @var{name} is known
+Identical to @code{ASM_OUTPUT_LABEL}, except that @var{name} is known
to refer to a compiler-generated label. The default definition uses
@code{assemble_name_raw}, which is like @code{assemble_name} except
that it is more efficient.
to make @var{name} weak.
@end defmac
+@defmac ASM_OUTPUT_WEAKREF (@var{stream}, @var{decl}, @var{name}, @var{value})
+Outputs a directive that enables @var{name} to be used to refer to
+symbol @var{value} with weak-symbol semantics. @code{decl} is the
+declaration of @code{name}.
+@end defmac
+
@defmac SUPPORTS_WEAK
A C expression which evaluates to true if the target supports weak symbols.
The default is that FDEs are not given nonlocal labels.
@end deftypefn
-@deftypefn {Taget Hook} void TARGET_UNWIND_EMIT (FILE * @var{stream}, rtx @var{insn})
+@deftypefn {Target Hook} void TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL (@var{stream})
+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.
+@end deftypefn
+
+@deftypefn {Target Hook} void TARGET_UNWIND_EMIT (FILE * @var{stream}, rtx @var{insn})
This target hook emits and assembly directives required to unwind the
given instruction. This is only used when TARGET_UNWIND_INFO is set.
@end deftypefn
these will be output by @code{TARGET_UNWIND_EMIT}.
@end defmac
+@deftypevar {Target Hook} bool TARGET_UNWID_TABLES_DEFAULT
+This variable should be set to @code{true} if the target ABI requires unwinding
+tables even when exceptions are not used.
+@end deftypevar
+
@defmac MUST_USE_SJLJ_EXCEPTIONS
This macro need only be defined if @code{DWARF2_UNWIND_INFO} is
runtime-variable. In that case, @file{except.h} cannot correctly
the target supports DWARF 2 frame unwind information.
@end defmac
-@deftypefn {Target Hook} void TARGET_ASM_EXCEPTION_SECTION ()
-If defined, a function that switches to the section in which the main
-exception table is to be placed (@pxref{Sections}). The default is a
-function that switches to a section named @code{.gcc_except_table} on
-machines that support named sections via
-@code{TARGET_ASM_NAMED_SECTION}, otherwise if @option{-fpic} or
-@option{-fPIC} is in effect, the @code{data_section}, otherwise the
-@code{readonly_data_section}.
-@end deftypefn
-
-@deftypefn {Target Hook} void TARGET_ASM_EH_FRAME_SECTION ()
-If defined, a function that switches to the section in which the DWARF 2
-frame unwind information to be placed (@pxref{Sections}). The default
-is a function that outputs a standard GAS section directive, if
-@code{EH_FRAME_SECTION_NAME} is defined, or else a data section
-directive followed by a synthetic label.
-@end deftypefn
-
@deftypevar {Target Hook} bool 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.
If not defined, the default is to return @code{NULL_RTX}.
@end deftypefn
+@deftypefn {Target Hook} bool TARGET_ASM_TTYPE (rtx @var{sym})
+This hook is used to output a reference from a frame unwinding table to
+the type_info object identified by @var{sym}. It should return @code{true}
+if the reference was output. Returning @code{false} will cause the
+reference to be output using the normal Dwarf2 routines.
+@end deftypefn
+
+@deftypefn {Target Hook} bool TARGET_ARM_EABI_UNWINDER
+This hook should be set to @code{true} on targets that use an ARM EABI
+based unwinding library, and @code{false} on other targets. This effects
+the format of unwinding tables, and how the unwinder in entered after
+running a cleanup. The default is @code{false}.
+@end deftypefn
+
@node Alignment Output
@subsection Assembler Commands for Alignment
@file{i386/i386.c}, for example.
@end deftypefn
+@deftypefn {Target Hook} bool TARGET_VALID_DLLIMPORT_ATTRIBUTE_P (tree @var{decl})
+@var{decl} is a variable or function with @code{__attribute__((dllimport))}
+specified. Use this hook if the target needs to add extra validation
+checks to @code{handle_dll_attribute}.
+@end deftypefn
+
@defmac TARGET_DECLSPEC
Define this macro to a nonzero value if you want to treat
@code{__declspec(X)} as equivalent to @code{__attribute((X))}. By
is in effect. The default is to return false to use @code{__cxa_atexit}.
@end deftypefn
+@deftypefn {Target Hook} void TARGET_CXX_ADJUST_CLASS_AT_DEFINITION (tree @var{type})
+@var{type} is a C++ class (i.e., RECORD_TYPE or UNION_TYPE) that has just been
+defined. Use this hook to make adjustments to the class (eg, tweak
+visibility or perform any other required target modifications).
+@end deftypefn
+
@node Misc
@section Miscellaneous Parameters
@cindex parameters, miscellaneous
@c prevent bad page break with this line
Here are several miscellaneous parameters.
-@defmac PREDICATE_CODES
-Define this if you have defined special-purpose predicates in the file
-@file{@var{machine}.c}. This macro is called within an initializer of an
-array of structures. The first field in the structure is the name of a
-predicate and the second field is an array of rtl codes. For each
-predicate, list all rtl codes that can be in expressions matched by the
-predicate. The list should have a trailing comma. Here is an example
-of two entries in the list for a typical RISC machine:
-
-@smallexample
-#define PREDICATE_CODES \
- @{"gen_reg_rtx_operand", @{SUBREG, REG@}@}, \
- @{"reg_or_short_cint_operand", @{SUBREG, REG, CONST_INT@}@},
-@end smallexample
-
-Defining this macro does not affect the generated code (however,
-incorrect definitions that omit an rtl code that may be matched by the
-predicate can cause the compiler to malfunction). Instead, it allows
-the table built by @file{genrecog} to be more compact and efficient,
-thus speeding up the compiler. The most important predicates to include
-in the list specified by this macro are those used in the most insn
-patterns.
-
-For each predicate function named in @code{PREDICATE_CODES}, a
-declaration will be generated in @file{insn-codes.h}.
-
-Use of this macro is deprecated; use @code{define_predicate} instead.
-@xref{Defining Predicates}.
-@end defmac
-
-@defmac SPECIAL_MODE_PREDICATES
-Define this if you have special predicates that know special things
-about modes. Genrecog will warn about certain forms of
-@code{match_operand} without a mode; if the operand predicate is
-listed in @code{SPECIAL_MODE_PREDICATES}, the warning will be
-suppressed.
-
-Here is an example from the IA-32 port (@code{ext_register_operand}
-specially checks for @code{HImode} or @code{SImode} in preparation
-for a byte extraction from @code{%ah} etc.).
-
-@smallexample
-#define SPECIAL_MODE_PREDICATES \
- "ext_register_operand",
-@end smallexample
-
-Use of this macro is deprecated; use @code{define_special_predicate}
-instead. @xref{Defining Predicates}.
-@end defmac
-
@defmac HAS_LONG_COND_BRANCH
Define this boolean macro to indicate whether or not your architecture
has conditional branches that can span all of memory. It is used in
unsigned one.
@end defmac
+@deftypefn {Target Hook} int TARGET_MIN_DIVISIONS_FOR_RECIP_MUL (enum machine_mode @var{mode})
+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
+that should be there for GCC to perform the optimization for a variable
+of mode @var{mode}. The default implementation returns 3 if the machine
+has an instruction for the division, and 2 if it does not.
+@end deftypefn
+
@defmac MOVE_MAX
The maximum number of bytes that a single instruction can move quickly
between memory and registers or between two memory locations.
@end defmac
@defmac VECTOR_STORE_FLAG_VALUE (@var{mode})
-A C expression that gives a rtx representing the non-zero true element
+A C expression that gives a rtx representing the nonzero true element
for vector comparisons. The returned rtx should be valid for the inner
mode of @var{mode} which is guaranteed to be a vector mode. Define
this macro on machines that have vector comparison operations that
@code{NULL} to put the pragma in the global namespace. The callback
routine receives @var{pfile} as its first argument, which can be passed
on to cpplib's functions if necessary. You can lex tokens after the
-@var{name} by calling @code{c_lex}. Tokens that are not read by the
+@var{name} by calling @code{pragma_lex}. Tokens that are not read by the
callback will be silently ignored. The end of the line is indicated by
a token of type @code{CPP_EOF}. Macro expansion occurs on the
arguments of pragmas registered with
For an example use of this routine, see @file{c4x.h} and the callback
routines defined in @file{c4x-c.c}.
-Note that the use of @code{c_lex} is specific to the C and C++
+Note that the use of @code{pragma_lex} is specific to the C and C++
compilers. It will not work in the Java or Fortran compilers, or any
-other language compilers for that matter. Thus if @code{c_lex} is going
+other language compilers for that matter. Thus if @code{pragma_lex} is going
to be called from target-specific code, it must only be done so when
building the C and C++ compilers. This can be done by defining the
variables @code{c_target_objs} and @code{cxx_target_objs} in the
target entry in the @file{config.gcc} file. These variables should name
the target-specific, language-specific object file which contains the
-code that uses @code{c_lex}. Note it will also be necessary to add a
+code that uses @code{pragma_lex}. Note it will also be necessary to add a
rule to the makefile fragment pointed to by @code{tmake_file} that shows
how to build this object file.
@end deftypefun
is wrong.
@end defmac
-@defmac TARGET_HAS_F_SETLKW
-Define this macro if the target supports file locking with fcntl / F_SETLKW@.
-Note that this functionality is part of POSIX@.
-Defining @code{TARGET_HAS_F_SETLKW} will enable the test coverage code
+@defmac TARGET_POSIX_IO
+Define this macro if the target supports the following POSIX@ file
+functions, access, mkdir and file locking with fcntl / F_SETLKW@.
+Defining @code{TARGET_POSIX_IO} will enable the test coverage code
to use file locking when exiting a program, which avoids race conditions
-if the program has forked.
+if the program has forked. It will also create directories at run-time
+for cross-profiling.
@end defmac
@defmac MAX_CONDITIONAL_EXECUTE
the value will be ignored.
@end deftypefn
-@deftypefn {Target Hook} bool TARGET_INSN_VALID_WITHIN_DOLOOP (rtx @var{insn})
+@deftypefn {Target Hook} const char * TARGET_INVALID_WITHIN_DOLOOP (rtx @var{insn})
-Take an instruction in @var{insn} and return true if it is valid within a
-low-overhead loop.
+Take an instruction in @var{insn} and return NULL if it is valid within a
+low-overhead loop, otherwise return a string why doloop could not be applied.
-Many targets use special registers for low-overhead looping. This function
-should return false for any instruction that clobbers these.
+Many targets use special registers for low-overhead looping. For any
+instruction that clobbers these this function should return a string indicating
+the reason why the doloop could not be applied.
By default, the RTL loop optimizer does not use a present doloop pattern for
-loops containing function calls or branch on table instructions.
+loops containing function calls or branch on table instructions.
@end deftypefn
@defmac MD_CAN_REDIRECT_BRANCH (@var{branch1}, @var{branch2})
may in turn cause a branch offset to overflow.
@end defmac
-@defmac ALLOCATE_INITIAL_VALUE (@var{hard_reg})
+@deftypefn {Target Hook} bool TARGET_COMMUTATIVE_P (rtx @var{x}, @var{outer_code})
+This target hook returns @code{true} if @var{x} is considered to be commutative.
+Usually, this is just COMMUTATIVE_P (@var{x}), but the HP PA doesn't consider
+PLUS to be commutative inside a MEM. @var{outer_code} is the rtx code
+of the enclosing rtl, if known, otherwise it is UNKNOWN.
+@end deftypefn
+
+@deftypefn {Target Hook} rtx TARGET_ALLOCATE_INITIAL_VALUE (rtx @var{hard_reg})
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
-it has been saved into can be used. @code{ALLOCATE_INITIAL_VALUE}, if
-defined, is called at the start of register allocation once for each
-hard register that had its initial value copied by using
+it has been saved into can be used. @code{TARGET_ALLOCATE_INITIAL_VALUE}
+is called at the start of register allocation once for each hard register
+that had its initial value copied by using
@code{get_func_hard_reg_initial_val} or @code{get_hard_reg_initial_val}.
Possible values are @code{NULL_RTX}, if you don't want
to do any special allocation, a @code{REG} rtx---that would typically be
@code{MEM}.
If you are returning a @code{MEM}, this is only a hint for the allocator;
it might decide to use another register anyways.
-You may use @code{current_function_leaf_function} in the definition of the
-macro, functions that use @code{REG_N_SETS}, to determine if the hard
+You may use @code{current_function_leaf_function} in the hook, functions
+that use @code{REG_N_SETS}, to determine if the hard
register in question will not be clobbered.
-@end defmac
+The default value of this hook is @code{NULL}, which disables any special
+allocation.
+@end deftypefn
@defmac TARGET_OBJECT_SUFFIX
Define this macro to be a C string representing the suffix for object
@end deftypefn
@deftypefn {Target Hook} const char *TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN (tree @var{typelist}, tree @var{funcdecl}, tree @var{val})
-If defined, this macro returns the diagnostic message when it is
-illegal to pass argument @var{val} to function @var{funcdecl}
+If defined, this macro returns the diagnostic message when it is
+illegal to pass argument @var{val} to function @var{funcdecl}
with prototype @var{typelist}.
@end deftypefn
+@deftypefn {Target Hook} {const char *} TARGET_INVALID_CONVERSION (tree @var{fromtype}, tree @var{totype})
+If defined, this macro returns the diagnostic message when it is
+invalid to convert from @var{fromtype} to @var{totype}, or @code{NULL}
+if validity should be determined by the front end.
+@end deftypefn
+
+@deftypefn {Target Hook} {const char *} TARGET_INVALID_UNARY_OP (int @var{op}, tree @var{type})
+If defined, this macro returns the diagnostic message when it is
+invalid to apply operation @var{op} (where unary plus is denoted by
+@code{CONVERT_EXPR}) to an operand of type @var{type}, or @code{NULL}
+if validity should be determined by the front end.
+@end deftypefn
+
+@deftypefn {Target Hook} {const char *} TARGET_INVALID_BINARY_OP (int @var{op}, tree @var{type1}, tree @var{type2})
+If defined, this macro returns the diagnostic message when it is
+invalid to apply operation @var{op} to operands of types @var{type1}
+and @var{type2}, or @code{NULL} if validity should be determined by
+the front end.
+@end deftypefn
+
@defmac TARGET_USE_JCR_SECTION
This macro determines whether to use the JCR section to register Java
classes. By default, TARGET_USE_JCR_SECTION is defined to 1 if both